Home All Groups Group Topic Archive Search About

Reading Lines from a File that is in Memory

Author
4 Aug 2006 6:23 PM
jcrouse
OK, based on someones ssuggestion in an earlier post I have some code
that reads a text file into memory. This is the code:

    Dim FileNum As Integer
    Dim TotalFile As String

    Open FileName For Binary As #1
    TotalFile = Space(LOF(1))
    Get #1, , TotalFile

Now the data is all in my variable, TotalFile. The data is structured I
know exactly which piece was pulled in from excatly which line in the
original text file so I don't need to do any seraching or string
manipulation, I simply want to read the file in memory a line at a
time. Is this possible in the format in which I have it stored? If so,
how? If now can I accomplish this some other way?

Thanks,
John

Author
4 Aug 2006 7:04 PM
GhostInAK
Hello jcrouse,

Uhh.. this is a vb.net group.  You'll want to try the vb6 group/s.

In .net you would create a Filestream, attach a streamreader, and call streamreader.readline.

-Boo

Show quoteHide quote
> OK, based on someones ssuggestion in an earlier post I have some code
> that reads a text file into memory. This is the code:
>
> Dim FileNum As Integer
> Dim TotalFile As String
> Open FileName For Binary As #1
> TotalFile = Space(LOF(1))
> Get #1, , TotalFile
> Now the data is all in my variable, TotalFile. The data is structured
> I know exactly which piece was pulled in from excatly which line in
> the original text file so I don't need to do any seraching or string
> manipulation, I simply want to read the file in memory a line at a
> time. Is this possible in the format in which I have it stored? If so,
> how? If now can I accomplish this some other way?
>
> Thanks,
> John
Author
4 Aug 2006 7:44 PM
jcrouse
Chit....sorry, my bad.

Thanks for the slap :)
John