Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ReadLine fails with Mac text files. Help!

20 views
Skip to first unread message

Cristian Viola

unread,
Jan 12, 2000, 3:00:00 AM1/12/00
to
I am using the Textream Object to open a text file, and perform some
parsing.

The problem is that performing a ReadLine on a Macintosh text file
actually reads the whole file (like a ReadAll). I *can* see why this is
happenning: ReadLine looks for 'chr(13) chr(10)' which is the DOS
CarriageReturn/LineFeed sequence. The Macintosh text files have only a
chr(13) in the sequence. To prove my theory, I actually saved the mac
file as DOS text, and readline works fine.

Is there any work around for this? I am desperate already...!

Thanks,
-Cristian

Michael Harris

unread,
Jan 12, 2000, 3:00:00 AM1/12/00
to
arMacLines = split(tsMacFile.ReadAll,chr(13))
 
now walk the array...

--
Michael Harris
 

 
"Cristian Viola" <cris...@consejero.com> wrote in message news:387CC439...@consejero.com...

Cristian Viola

unread,
Jan 13, 2000, 3:00:00 AM1/13/00
to
Thanks. Actually, I found the following alternative to
line = objStoryTS.readline :


line = "" 'reset line content
do while instr(line,chr(13)) = 0
line = line & objStoryTS.read(1)
loop


This works for both Mac and DOS formatted text files, so I need not
worry.
I thought this would be REALLY slow, but I found no performance hit over
the standard readline.


-CV


--------------------------------------------

Subject:
Re: ReadLine fails with Mac text files. Help!
Date: Wed, 12 Jan 2000 17:36:12 -0800
From: "Michael Harris" <Please...@To.NewsGroup>

0 new messages