Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Combining files

by vitoco (Friar)
on Oct 02, 2009 at 15:10 UTC ( #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.


Comment on Re^5: Combining files
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2015-07-29 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls