Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Will this help?

by Rhose (Priest)
on Oct 02, 2009 at 14:08 UTC ( #798861=note: print w/ replies, xml ) Need Help??


in reply to Reaped: This is rubbish I know.

Maybe something like:

type * 2>NUL | perl -n -e "print if /^Total\s\d{1,5}/;" > ..\newFile

When you use type with a wildcard like this, the file name being "typed" is sent to STDERR. The above removes those by redirecting STDERR to NUL (aka "the bit bucket".) The -n switch on perl wraps the program in a "while (<>) {}" loop... the "program" then prints the line if the pattern matches what you want (please note, you'll have to play with the pattern to make it what you really want). Those results are then redirected to newFile in the parent directory.

Again, the pattern I have is not exactly the same as yours (for example, I anchored it to the start of the line.) You might also want to make it case insensitive.

I'm not around very much, so chances are I may well miss any follow up questions... I'm just hoping this helps out a tad.


Comment on Will this help?
Download Code
Re: Will this help?
by Win (Novice) on Oct 02, 2009 at 14:58 UTC
    I get the following error message with that.
    Can't open ..\newFile_totals_removed: No such file or directory.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-04-24 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (557 votes), past polls