Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by davido (Cardinal)
on Jan 24, 2006 at 18:32 UTC ( [id://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

Replies are listed 'Best First'.
Re^3: repeat data at one line and grep as pre-set format
by Random_Walk (Prior) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://525276]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-18 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found