Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Just another Perl shrine
 
PerlMonks  

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

by demerphq (Chancellor)
on Jan 24, 2006 at 03:55 UTC ( [id://525130]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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

perl -aF/\s+/ -lne"print join qq(\t),splice(@F,0,2) while @F" t.txt

Adjust the quotes to suite your shell.

---
$world=~s/war/peace/g

Replies are listed 'Best First'.
Re^2: repeat data at one line and grep as pre-set format
by benlaw (Scribe) on Jan 24, 2006 at 04:01 UTC
    Great thanks!!

      Its not at all clear what you meant by "grep" in this context. Nothing is being grepped.

      ---
      $world=~s/war/peace/g

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://525130]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.