Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: removing all whitespace but newlines

by Gilimanjaro (Hermit)
on Jan 28, 2003 at 20:17 UTC ( [id://230721]=note: print w/replies, xml ) Need Help??


in reply to removing all whitespace but newlines

Or using my newlyfound perlrun knowledge:

When there never are spaces in the end of the 12 characters, and you're sure all lines do contain 12 non-space characters:

perl -i -lpe 's/\s+^//' myfile

Or the foolproof way:

perl -lne '/^.{1,12}/; printf "%-12s\n",$&' myfile

I think I just started playing perlgolf...

Log In?
Username:
Password:

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

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

    No recent polls found