Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://798876]
help
Chatterbox?
[1nickt]: Sigh, this is why I gave up human-only languages and became a Perl linguist :-)
[Discipulus]: i just, rarely, downvote unpolite posts and spam, and wrong advices
[Discipulus]: discutere in eatalian is neutral: but discutere with wife sounds implicitly negative..
[erix]: what's the offending signature?
[Discipulus]: 'give man a fish erix it sonds like a push towards omosexuality.. ;=)
[Discipulus]: see Re: from txt file to array erix
[erix]: yeah, I ask for the text (I don't see signatures)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-06-22 12:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (519 votes). Check out past polls.