Re: Reading a text file
From: Bob Butler (tiredofit_at_nospam.com)
Date: 06/14/04
- Next message: Björn Holmgren: "Re: Make vbScript An Exe"
- Previous message: Björn Holmgren: "Re: Reading a text file"
- In reply to: Brian: "Reading a text file"
- Next in thread: Gale Green: "Re: Reading a text file"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Jun 2004 07:36:37 -0700
"Brian" <bfordSPAMOFF@markem.com> wrote in message
news:%23jVl8vhUEHA.3780@TK2MSFTNGP10.phx.gbl
> I need to use VB6 to read in and parse through a text file one line
> at a time, I was hoping to use Line Input but that doesn't work
> becaue the text file only contains a line feed and no carriage
> returns.
>
> How can I read in 1 line at time with only the line feed to work
> with? do I have to do this one char at a time, I hope not :(
If the file isn't too big read it all into a single string and use
Instr/Left$/Mid$/Right$ to search for vbLf and pull the string apart or use
the Split function to make it into an array. If the file is larger than
you'd like to work with in one piece then read chunks at a time and do the
same thing - just be careful to retain any partial lines in each chunk read
when reading the next piece.
-- Reply to the group so all can participate VB.Net... just say "No"
- Next message: Björn Holmgren: "Re: Make vbScript An Exe"
- Previous message: Björn Holmgren: "Re: Reading a text file"
- In reply to: Brian: "Reading a text file"
- Next in thread: Gale Green: "Re: Reading a text file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|