in reply to Text File Parsing.

That looks like a file that has just linefeeds instead of \cr\lf.

perl -pe "s/^\s+//" file > newfile
might fix your problem, if it's really leading spaces.

The PerlMonk tr/// Advocate

Replies are listed 'Best First'.
Re: Re: Text File Parsing.
by melora (Scribe) on Nov 25, 2003 at 00:45 UTC
    It looks to me, too, like the file contains line feeds but no carriage returns, like a UNIX file. Such files contain line feeds as line endings; Mac systems use carriage returns without line feeds; and DOS systems use carriage return-line feed combinations as line endings. This is to help minimize the chance that any software or data will be transferred between systems<grin>. I should think that changing the '0a' characters (if this is indeed the trouble) to 'odoa' sequences would do the job. (Where 0d is 13 and 0a is 10; I'm just used to talking in hex.)