Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Text File Parsing.

by Roy Johnson (Monsignor)
on Nov 24, 2003 at 21:13 UTC ( [id://309690]=note: print w/replies, xml ) Need Help??


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.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://309690]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-23 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found