CRLF in Windows OS gives a double space
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
CRLF in Windows OS gives a double space
Hi,
A ".txt" file, opened with Windows notepad, appears "single-spaced".
But, when that file is "read" into my REV script, using the URL command, and placed into a field, it appears "double-spaced". Then if that field is written to a new .txt file using the URL command, that new file also is "double-spaced" when opened in Windows notepad.
Is there a way to "replace" the CRLF that is causing the double spacing and get single spaced text into the REV field?
Thanks for any ideas.
A ".txt" file, opened with Windows notepad, appears "single-spaced".
But, when that file is "read" into my REV script, using the URL command, and placed into a field, it appears "double-spaced". Then if that field is written to a new .txt file using the URL command, that new file also is "double-spaced" when opened in Windows notepad.
Is there a way to "replace" the CRLF that is causing the double spacing and get single spaced text into the REV field?
Thanks for any ideas.
Ken
replace CRLF with CR
Malte,
Thanks for your quick reply.
I had already tried that replace code, and it did not alter the result.
My OS is windows XP, and this issue seems to be in how REV and the OS interpret the CRLF.
I might add that this is happening on a .txt file that is "written" directly to disk by another program, so I don't know if that program is using an unexpected control character for the CRLF.
Any other ideas?
Thanks for your quick reply.
I had already tried that replace code, and it did not alter the result.
My OS is windows XP, and this issue seems to be in how REV and the OS interpret the CRLF.
I might add that this is happening on a .txt file that is "written" directly to disk by another program, so I don't know if that program is using an unexpected control character for the CRLF.
Any other ideas?
Ken
if you mean "all chars have additional spaces" when you say double-spaced, then most likely the original file is unicode of some sorts. I never have used it, but rev has ways to read unicode text.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
double spaced
Bvg,
Sorry for the confusion. No, by "double spaced" I meant that each line seems to have 2 CRLF characters. The text on each line has no unwanted spaces within the individual characters. But, after each line, there is a blank line before the next line of text. Here is an example:
2008-07-03,115.953125,6,510,115.953125,115.968750,1978,0,0
2008-07-03,115.953125,12,504,115.953125,115.968750,1976,0,0
2008-07-03,115.953125,1,492,115.953125,115.968750,1974,0,0
The original file is written to disk by a program that takes data directly from a port feed. Perhaps there is some unusual transmission code involved.
Again, thanks for the help.
Sorry for the confusion. No, by "double spaced" I meant that each line seems to have 2 CRLF characters. The text on each line has no unwanted spaces within the individual characters. But, after each line, there is a blank line before the next line of text. Here is an example:
2008-07-03,115.953125,6,510,115.953125,115.968750,1978,0,0
2008-07-03,115.953125,12,504,115.953125,115.968750,1976,0,0
2008-07-03,115.953125,1,492,115.953125,115.968750,1974,0,0
The original file is written to disk by a program that takes data directly from a port feed. Perhaps there is some unusual transmission code involved.
Again, thanks for the help.
Ken
Hi Ken,
sorry for the confusion. You would need to do the replace before you put the data into the field. Read the URL into a variable replace there and put into a field fterwards. Or do a replace cr&cr with cr on the field or filter the field without empty. There is a few choices to go about this. The reason is, that rev converts lf to cr characters internally when putting data into the field. So for rev it looks like a double cr character instead of lf.
Hope that helps,
malte
sorry for the confusion. You would need to do the replace before you put the data into the field. Read the URL into a variable replace there and put into a field fterwards. Or do a replace cr&cr with cr on the field or filter the field without empty. There is a few choices to go about this. The reason is, that rev converts lf to cr characters internally when putting data into the field. So for rev it looks like a double cr character instead of lf.
Hope that helps,
malte