Find [CR][LF] in text file. {SOLVED}
Posted: Sun Apr 17, 2022 4:27 pm
I have been trying all day to work out a very simple string manipulation, but I keep coming up blank. I have a simple text file where sections of the file are identified and separated by a double [CR][LF]. When I ReadFile() and perform a ReadString() I want to locate these double [CR][LF] and strip them from the end of the incoming string.
Here's how the file opens in Notepad++:
https://www.mediafire.com/view/bjk0a3qa ... P.png/file
Obviously I am doing something stupid, so any guidance would be welcome.
Dave
Here's how the file opens in Notepad++:
https://www.mediafire.com/view/bjk0a3qa ... P.png/file
Code: Select all
CRLF.s = Chr($D) + Chr($A) + Chr($D) + Chr($A)
InFile.s = "Dummy.txt"
Test.s = ""
If ReadFile(0, InFile)
While Eof(0) = 0
Test = ReadString(0)
If FindString(Test, CRLF)
Debug "FOUND IT!!!"
Else
Debug "WTF???"
Endif
Wend
CloseFile(0)
Endif
Dave