Re: Fastest Way to Append Chars to Text File Rows in VB6.0
- From: "Gary Nelson" <gn@xxxxxxxxxx>
- Date: Mon, 13 Jun 2005 20:43:19 +0100
Rita,
If speed is really important, you might consider reading them also in
binary, it is much faster than Line Input. The fastest is to read a big
chunk (say 64K) and use Mid$ to read the individual 496 char. records.
Gary
"RitaG" <RitaG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D08E89C8-AE3A-4AE4-AEF9-D7FC82D8267A@xxxxxxxxxxxxxxxx
> Thanks so much Jim and Bob for your quick responses.
> I didn't think about using the "Binary" option.
>
> Gotta love these forums!
>
> Rita
>
> "Jim Mack" wrote:
>
>> RitaG wrote:
>> > Hi.
>> >
>> > I have about 60 text files containing rows 496 chars long. I need to
>> > cycle through all these files and append some additional chars at the
>> > end of each row. Some of the files are large, containing over 1
>> > million rows.
>> >
>> > The options I'm currently thinking of are the FileSystemObject
>> > ReadLine (I may run out of memory using ReadAll), append the chars at
>> > the end of the line and then use WriteLine to write to an output
>> > file. I could also use the "Open" file method using a handle and the
>> > Print # statement. I don't know which is the fastest way.
>> >
>> > Any suggestions will be greatly appreciated!
>>
>> I don't think you'll find anything much faster than something along these
>> lines:
>>
>> Open "A" For Input As xx
>> Open "B" For Binary As yy
>> Do While Not EOF(xx)
>> Line Input #xx, Buf$
>> Put yy,,Buf$ & NewInfo$
>> Loop
>> Close xx
>> Close yy
>>
>>
.
- Follow-Ups:
- References:
- Prev by Date: Re: Fastest way to read characters
- Next by Date: Re: single
- Previous by thread: Re: Fastest Way to Append Chars to Text File Rows in VB6.0
- Next by thread: Re: Fastest Way to Append Chars to Text File Rows in VB6.0
- Index(es):
Relevant Pages
|