Read and write a simple text file
Read and write a simple text file
Rate Read and write a simple text file
(1(1 Vote))
Open "C:\1.txt" for Input As #1
'Open the file for reading and number it as #1
Input #1, line1$, line$, line3$
'Read the first three lines of the file
Close #1
'Close the file.
'*****Write file**********
Open "C:\1.txt for Output As #2
'Open the file to write
Print #2, "This is line 1"
'Write something in the first line
Print #2, "This is line 2"
'Write something in the second line
Print #2, "This is the last line"
'Write something in line 3
Close #2
'Close the file
Read and write a simple text file Comments
No comments yet — be the first to post one!
Post a Comment