Removing CRLF from text

J. Landman Gay jacque at hyperactivesw.com
Wed Aug 6 20:28:42 EDT 2008


mfstuart wrote:

> I've used this script, and variations of it, to remove these characters: +
> CRLF.
> It removes the + char, but still leaves each ini entry split into multiple
> lines.

<snip>

>   repeat for each line L in tData

When a script gets a line of text, the engine omits the end of line 
character(s) and returns only the text of the line itself. That is why 
the lines stay separated, since the line delimiters are left intact. (It 
works just like items; when you get an item from a string, the comma is 
not included.) Instead of working on each line, work on the entire block 
of text as a whole. You should be able to do it like this:

put URL ("file:" & tFilename) into tData
put "+"&CR&LF into tChars
replace tChars with space in tData

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list