Re-2: Removing CRLF from text

Mark Stuart mfstuart at
Sat Aug 9 23:01:53 EDT 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":



on mouseUp

  --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"

end mouseUp



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. :-)



Mark Stuart

More information about the use-livecode mailing list