#!/usr/bin/perl
$x=1; #first file who will open will be file20061.trf change if you need
$xmax=9999; #change this as you need is the limite of files
$patternb="file2006"; #begin of filename
$patterne=".trf"; #end of filename
while($x!=$xmax){
$y=0;
@lines=();
$file=$patternb . $x . $patterne;
open(FD,"< $file")|| $y=1;
@lines=<FD>;
close(FD);
@lines=reverse(@lines); #\
pop(@lines); # - Remove First Line
@lines=reverse(@lines); #/
open(FD,"> $file") if $y!=1;
print FD @lines if $y!=1;
close(FD);
$x++; #and loop
}
ps: the script need to be at the same directory of the files
# Print a list of files with 'find', feed it into while loop.
# For each filename, open file, read and discard first line,
# print rest of file, while redirecting all output into 'output'
find ./ -iname 'file2006*' |
while read FILE
do
( read LINE ; cat ) < "${FILE}"
done > output
Note that any of these solutions that use shell-globbing instead of find will break on large numbers of files... I used find since I figured there might be thousands of those autogenerated files.