Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by Tux (Canon)
on Nov 24, 2011 at 13:04 UTC ( [id://939878]=note: print w/replies, xml ) Need Help??


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

In the spirit of TIMTOWTDI ...

$ perl -pe'eof&&chomp' file | nextprocess $ perl -0pe's/\n\Z//' file | nextprocess

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

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

    No recent polls found