Adam9 Posted May 8, 2005 Posted May 8, 2005 I have no problems with this in WinXP, but I do on WinME. I'm using InetGet to download an INI file to read from. I'm saving it to the temp dir. On WinME, it can't read the file properly. I opened the file in notepad and instead of normal line breaks, it shows the control character blocks. Example: WinXP: Line 1 Line 2 Line 3 WinME: Line1(BLOCK)Line2(BLOCK)Line3 It shows two control character blocks for each line. I'm assuming the first one represents \r and the second one is \n. Any ideas on how I can fix this without coding a function to split the line on the control character blocks and inserting a @LF?
scriptkitty Posted May 9, 2005 Posted May 9, 2005 (edited) $file=Stringreplace($file,@lf,@crlf) it might be: $file=Stringreplace($file,@cr,@crlf) Normally you only need one of the characters, linefeed or charagereturn. Windows prefers to have both. a simple conversion script: $fileN="text.ini" $file=Fileread($fileN,Filegetsize($fileN)) $file=filereplace($file,@crlf,@lf); if it already has the right returns $file=filereplace($file,@cr,@lf); incase they used only @cr $file=filereplace($file,@lf,@crlf); change all line feeds to @crlf ; save the file how you like (as backup, overwrite, or?) Edited May 9, 2005 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers.
Adam9 Posted May 10, 2005 Author Posted May 10, 2005 Thanks for the response. I see how that would work. I ended up running unix2dos on the server to add the extra linefeeds in so that Win9x could read it. It works now
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