I am not sure what else to use off hand, the following code was an attempt to determine what kind of source OS generated the text file... for MAC EOL is a CR, *nix system LF and DOS/Windows CRLF but in this code the LF is always gobbled so it appears to be a MAC based text file even though it was generated on Windows. What else can I use to properly determine EOLs correctly.
DataLine = FileGet(fileToRead)
Message("DataLine is", DataLine)
EOLCHK = strsub(Dataline,(strlen(dataline)-2),2)
Message("*EOLCHK",">...":ChrStringToHex(EOLCHK):"...<")
if (strsub(EOLCHK,2,1) == @LF && StrSub(EOLCHK,1,1) == @CR) then Message("DOS/WIN EOL"," CR/LF ")
if (strsub(EOLCHK,2,1) == @LF && StrSub(EOLCHK,1,1) != @CR) then Message("*NIX EOL", "Just a LF")
if (strsub(EOLCHK,2,1) == @CR && StrSub(EOLCHK,1,1) != @CR) then Message("MAC EOL","Just a CR")
Regards,
Keith
The line EOLCHK = strsub(Dataline,(strlen(dataline)-2),2) should be EOLCHK = strsub(Dataline,(strlen(dataline)-1),2).
Duh, sorry, I should have caught that...
T H A N X !!