Re-2: Removing CRLF from text
mfstuart at cox.net
mfstuart at cox.net
Thu Aug 7 13:39:26 EDT 2008
Hi all,
I’ve tried all replies to this issue and the one that works is from Martin Baxter, using:
put URL ("binfile:" & tFilename) into tData
put tData into fld “Original” --this results in displaying a “box” character at the end of each line
--now look for the set of string characters that I want to remove
put "+" & CRLF into tmatchstring --the order that the string you’re looking for is important
replace tmatchstring with space in tData
replace " " with empty in tData --the replace character is the last char of each line from the “Original” field. I copied this character into the script
--place the result into a field for display
put tData into fld "Changed"
>From my “Changed” field (the result of the script), I copied the text from it, saved it with Notepad and viewed the file with a Hex Editor.
The characters at the end of each line are:
(Hex=0d0d0a) which is 13 13 10
RunRev translation:
cr cr lf
Remember, this is all from using…
put URL ("binfile:" & tFilename) into tData
>From the saved file above, I used it as the ini file for the software application, and the application works with it – no problem.
The net result is, this works using: put URL (“binfile:”….. when trying to do what I need to do …
… bring “broken” INI entries into one line, per ini entry.
Thanx all for your interesting responses.
It shows how awesome, diverse and I might say in a nice way, indulgent, each RunRev developer is.
Regards,
Mark Stuart
p.s. I sent this same email from my work email address (which is not registered with this list), so you may see it twice.
More information about the use-livecode
mailing list