Re-2: Removing CRLF from text
mfstuart at cox.net
Sat Aug 9 22:01:53 CDT 2008
Kay C Lan wrote:
Mark, although you seem to have got a solution with binfile, does it work
with 'file' but just replacing "+" & LF ?
Also agree that everything learnt from this thread should make it to the
newsletter. I volunteer Mark Stuart ;-)
Kay, you are correct in your question. :-)
Here's the script using just "file":
--clear display fields on card
--these fields are for displaying the results.
put empty into fld "Before"
put empty into fld "After"
--fetch the file
put "c:\temp\some.ini" into tFilename
put URL ("file:" & tFilename) into tData
put tData into fld "Before"
replace "+" & LF with empty in tData
put tData into fld "After"
After reading all the threads on this topic, I deduce the following:
When reading the file into a memory variable, RunRev applies manipulation to
the EOL chars in the tData variable.
It replaces CR and LF with just LF.
So when using - put URL ("file:" & tFilename) into tData - I would use the
"+" & LF, in this case.
And this is because of cross platform compatibility?
Would I be correct in my deductions?
I would like to find this in the products documentation somewhere. Anyone
know where I might find this?
And Kay, on you volunteering me - no problem, but I find myself unqualified
to do so. :-)
More information about the use-livecode