Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: Combining files

by vitoco (Hermit)
on Oct 02, 2009 at 15:10 UTC ( [id://798876]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Combining files
in thread Combining files

Use pipe "|" instead of ">" to pass data from one program to another:

type * | perl -ne "print unless /^Total\s\d{1,5}/" > ..\newFile

Using only Perl:

perl -e "while (<*>) {open(F,$_) or next;while(<F>){print unless /^Tot +al\s\d{1,5}/}}" > ..\newFile

Note: this code has errors, but works as an example.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2026-02-17 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    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.