Read from file problem
Dave
dave at looktowindward.com
Thu Nov 15 07:20:37 EST 2007
Hi,
I tied all this, unfortunately it doesn't work, cos (on Mac anyway)
cr = lf = 0x0A, e.g. RunRev maps cr or lf into a lf.
Try this in the message box:
put chartoNum(lf) && chartoNum(cr)
Cheers
Dave
On 14 Nov 2007, at 19:51, Brian Yennie wrote:
> Dave,
>
> How about something like this. Untested, but the idea is:
>
> Read in the lines as if they are all "cr" delimited. If the first
> character of a line is a linefeed, then you just passed a crlf
> ending (so just delete the linefeed). For any additional embedded
> linefeeds, split them off as new lines.
>
>
> read from file theXMLFilePathName until cr
> put it into tLine
> if (char 1 of tLine = linefeed) then delete char 1 of tLine
> replace linefeed with cr in tLine
> repeat for each line l in tLine
> processLine l
> end repeat
>
>> Hi,
>>
>> I am trying to read text files line by line, but have come across
>> a file that doesn't have consistent line endings. The command I
>> use is:
>>
>> read from file theXMLFilePathName until cr
>>
>> When I looked in the file it has some lines ending in cr, some in
>> lf and some in crlf.
>>
>> How can I read up to either of these characters (cr/lf) ?
>>
>> Thanks a lot
>> All the Best
>> Dave
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list