polps Posted May 13, 2008 Posted May 13, 2008 Hello all, 1) I open a text file (FileOpen with option "2") 2) I read the lines (FileReadLine) 3) I change some of them (StringReplace, StringStripWS, etc ...) 4) I write the new lines on a new text file (FileWriteLine). Opening the new file: with Notepad I see some strange symbol; with Scite I see in some line CR+LF but in other line I see only CR. I don't understand why, maybe it dipend the way I change the line (item 3). Now, I'm trying to add a LF at the end of the lines before the FileWriteLine (using: $string = $string & Chr(10) ), but this way doesn't seems to work properly!! Note that: a) In the original file each line end with CR+LF If I open the new file with Scite and I use the option "Convert Line End Character" the file is saved in the right format. Has anyone some idea about this? Tank in advance Gianluca
monoceres Posted May 13, 2008 Posted May 13, 2008 Maybe this? $handle=FileOpen("file.txt",0) $handle2=FileOpen("newfile.txt",2) Do $line=FileReadLine($handle) If $line<>"" Then ; Do whatever processing you want here: FileWrite($handle2,$line&@LF) ContinueLoop ; Just fooling around with the loop :P EndIf Until True Broken link? PM me and I'll send you the file!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now