Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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

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
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 drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2016-10-01 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (9 votes). Check out past polls.