in reply to perl onliner on multiple files
This (untested) may do what you want:
perl -nE"/: / and $c+= (split/: /)[0]; if( eof(ARGV) ){ say qq[SUM.$AR +V =$c]; $c=0 }" tmp_*
provides the while(<>){} loop.
checks for the end of each individual file, prints the results and resets $c to 0.
gives you the names of the individual files in the output.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl onliner on multiple files
by abhay180 (Sexton) on Feb 08, 2013 at 21:16 UTC | |
by BrowserUk (Patriarch) on Feb 08, 2013 at 22:35 UTC | |
by 7stud (Deacon) on Feb 08, 2013 at 23:54 UTC | |
by abhay180 (Sexton) on Feb 09, 2013 at 10:05 UTC | |
by Anonymous Monk on Feb 09, 2013 at 09:24 UTC |