outfile will now containuse strict; open (INFILE, "<infile") or die "could not open file"; open (OUTFILE, ">outfile") or die "could not open file"; <INFILE>; # dump the header on the first line while (<INFILE>) { print OUTFILE join(" ", (split "~", $_)[0,3]), "\n"; } close INFILE; close OUTFILE;
--UPDATE--D:\minibuild\nbsssbs\appl\src\erlmtrihm.cxx 444912 D:\minibuild\nbsssbs\appl\src\erlmtrihm.cxx 966656 D:\minibuild\nbsssbs\appl\src\erlmtrihm.cxx 190994 D:\minibuild\nbsssbs\appl\src\erlmtrihm.cxx 194417 D:\minibuild\nbsssbs\appl\src\erlmtrihm.cxx 916765 D:\minibuild\nbsssbs\appl\src\erlmtrihm.cxx 955515
After thinking about this at lunch. This could be a one liner.
or evenperl -e '$,=" ";while (<>) {print ((split "~", $_)[0,3],"\n") if (/~/) +}'<infile >outfile
perl -aF/~/ -ne '$,=" ";print (@F[0,3],"\n") if /~/' infile >outfile
--
flounder
In reply to Re: match from a file and output to another
by flounder99
in thread match from a file and output to another
by amoura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |