try awk
. This will print a messages suggesting the file number being processed, followed by the line matching the pattern. I have chosen the pattern here to be character p as that was easy for my testing. You can replace with any valid regex for your purpose.
awk -v PAT="p" 'FNR == 1 { n++; printf "Processing %d of %d files\n", n, ARGC - 1 >> "/dev/stderr"} FILENAME ~ /.gz$/ {print "Skipping gz file: ", FILENAME; nextfile} /PAT/'
Explanation
awk -v PAT="p" '
FNR == 1 { # Every first line of the file
n++; # Counter for file being processed
printf "Processing %d of %d files\n", # Print message
n, # file number
ARGC - 1 # Number of files on CLI
>> "/dev/stderr" # Redirect to stderr
}
FILENAME ~ /.gz$/ { # Skip gunzip files
print "Skipping gz file: ", FILENAME;
nextfile # move to next file
}
/PAT/ # Pattern to print
'
UPDATE
Updated the code to skip the gunzip (.gz) files when processing.