I think you are looking for the -n (or -p) option? It will execute the perl code (generally a oneliner with -E, but it can also work with a file) over each line of each file passed as an argument, and sets $_ to the content of the line. If you use the -n option you have to print whatever output you need yourself, with the -p option it prints the (possibily modified) content of $_ after each line. The variable $ARGV contains the name of the currently processed file.
Eg:
perl -nE 'say "$ARGV: $_" if /Valid/' file1 file2 file3
will print all the lines from each three files that contain "Valid".
In reply to Re: Merge and split files based on number of lines
by Eily
in thread Merge and split files based on number of lines
by Sekhar Reddy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |