Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How to chomp the last new line character from the file

by jmcnamara (Monsignor)
on Nov 24, 2011 at 11:33 UTC ( [id://939855]=note: print w/replies, xml ) Need Help??


in reply to How to chomp the last new line character from the file

Here is one way:

perl -i -pe 'chomp if eof' file1 file2 ...

--
John.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found