Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: perl one-liner, is it possible?

by olus (Curate)
on Feb 07, 2006 at 12:11 UTC ( [id://528479]=note: print w/replies, xml ) Need Help??


in reply to perl one-liner, is it possible?

Sure!
perl -i -e '$/=\32000; while(<>) {s/\s{2}//sg;print $_;}' oid.ldif

Change the input record separator, so that instead of the reading of the file breaks on new lines, we read chunks of data.
Next, just substitute the two white space characters ('\n' and ' ') with nothing and the lines get concatenated.

--
olus

Replies are listed 'Best First'.
Re^2: perl one-liner, is it possible?
by Mago (Parson) on Feb 09, 2006 at 09:30 UTC
    perl -pi -e 'BEGIN { $/=\32000 } s/\s{2}//sg' oid.ldif


    Mago
    mago@rio.pm.org


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-04-25 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found