Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21297

Random Access Record lenght

$
0
0
I have logs written as a random access files. The len is 256 and the data is 80 bytes/characters per record.

I am trying to get VB to start at the beginning of the file and read each 80 bit section in the file out to separate lines in a txt.

The files have varying amounts of information all organized in 80 character string.

The problem im having is getting it to keep reading until the file is over. Here is the code i have so far but it doesn't work.

Code:

Private Sub Command1_Click()
Open "a:\ltmed.txt" For Random As #1 Len = 256
Open "C:\Test\Patient.txt" For Output As #2
Do While Not EOF(1)
Get #1, 80, a
Print #2, a

Loop
Close #1
Close #2

End Sub


Viewing all articles
Browse latest Browse all 21297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>