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

Re^4: Combining files

by Win (Novice)
on Oct 02, 2009 at 12:29 UTC ( [id://798841]=note: print w/replies, xml ) Need Help??


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

Using Perl? Perhaps I need to write a Perl program in to do that step. The Perl program one liner could have a system call in it. Maybe actually it would be better if a Perl execution was incorporated into the DOS prompt argument? Maybe something like:

type *>"perl -w while(<STDIN>){$_ =! /Total\s\d{1,5}/g;}}" >..\newFile #This is rubbish I know. Just as an example though.

Replies are listed 'Best First'.
Re^5: Combining files
by vitoco (Hermit) on Oct 02, 2009 at 15:10 UTC

    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://798841]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2025-07-18 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.