CRLF vs CR&LF
Posted: Thu Dec 28, 2017 11:22 pm
Good morning. Hello,
I'm looking to get the preview of Windows files.
To do this inside the file, I found the text to recover. It's start by "PNG" and ended by "IEND".
So I open the file with "open" I read it with "read" and close it with "close". I put "it" in a variable. I search for PNG and IEND and remove what is before and after. And I recreate a PNG file with this content. The concern is that when I put this in a variable, Livecode doesn't differentiate between "CRLF","LF" and "CR" at the end of the line. He puts it all in "CRLF". And as with every line, it's never the same, sometime "CR" and sometime "LF". It is almost impossible for me to change it automatically.
I also tried another approach. A full copy of the file with "revCopyFile", but in this case I can't delete the text before and after.
I'm in a dead end.
Do you have an idea or a solution to get me out of here?
Is there another way to get the preview?
Is it possible to force livecode to keep the "LF" and "CR" in a variable?
How do I delete text in a file without using a variable?
Thank you in advance
Krynn
I'm looking to get the preview of Windows files.
To do this inside the file, I found the text to recover. It's start by "PNG" and ended by "IEND".
So I open the file with "open" I read it with "read" and close it with "close". I put "it" in a variable. I search for PNG and IEND and remove what is before and after. And I recreate a PNG file with this content. The concern is that when I put this in a variable, Livecode doesn't differentiate between "CRLF","LF" and "CR" at the end of the line. He puts it all in "CRLF". And as with every line, it's never the same, sometime "CR" and sometime "LF". It is almost impossible for me to change it automatically.
I also tried another approach. A full copy of the file with "revCopyFile", but in this case I can't delete the text before and after.
I'm in a dead end.
Do you have an idea or a solution to get me out of here?
Is there another way to get the preview?
Is it possible to force livecode to keep the "LF" and "CR" in a variable?
How do I delete text in a file without using a variable?
Thank you in advance
Krynn