PDA

View Full Version : Solved: Strange new line characters may be a problem for my FileSystemObject's in WSH



SparceMatrix
07-24-2006, 01:11 PM
I am trying to process some log files generated by a ported Linux program "wget". If I open wget's logfiles in Notepad or Wordpad I don't see anything unusual. But if I process these logs moving them from an OpenTextFile to a RegExp processed MyTextStream.Write text file, I start seeing these odd square end-of-line characters when I open them in Notepad. Actually, I suspect that they show up before they reach the RegExp part of my processing because I search for "\r\n" in order to remove extra ones and these expressions can't seem to find them. They don't show up if I open the file in WordPad.

Does anyone have any idea what might be going on? I've tried tinkering with various OpenTextFile and CreateTextFile format permutations to see if this is a Unicode/ASCII issue, but this doesn't appear to change anything.

SparceMatrix
07-24-2006, 02:29 PM
This program wget is originally in Linux and somewhere the difference between Line Breaks in Linux and Windows is manifesting itself. In Windows files the Line Break is CR (Carriage Return) and LF (Line Feed) together and in Linux, it is just LF. To find the Line Break in a Linux file you must look for LF -- or \n in RegExp alone and not \r\n