Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: repeat data at one line and grep as pre-set format

by davido (Archbishop)
on Jan 24, 2006 at 18:32 UTC ( #525276=note: print w/ replies, xml ) Need Help??


in reply to Re: repeat data at one line and grep as pre-set format
in thread repeat data at one line and grep as pre-set format

cat yourfile.txt | perl -ple 's/(\S+\s+\S+)\s+/$1\n/g'

Isn't that the same as:

perl -ple 's/(\S+\s+\S+)\s+/$1\n/g' yourfile.txt

UUOC.


Dave


Comment on Re^2: repeat data at one line and grep as pre-set format
Select or Download Code
Re^3: repeat data at one line and grep as pre-set format
by Random_Walk (Parson) on Jan 25, 2006 at 09:58 UTC

    You are right and your way is more efficient too. I wrote it with the cat file | as that is how I tested it with echo, just failed to engage my brain completely :-)

    Cheers,
    R.

    Pereant, qui ante nos nostra dixerunt!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-12-18 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (48 votes), past polls