I need help to create a file using Perl

Hi, i have some files in text format and i want to create a file with all the information in the others files, but i don't want copy all the information exactly i just need the information from the fourth line to the end of file

I will try to explain with an example:

file1.txt

abc
abc
abc
abc
cde1
cde1

file2.txt

abc
abc
abc
abc
cde2
cde2

and i want a file like this

file.txt

cde1
cde1
cde2
cde2

I wonder if it is possible to make it using PERL, if somebody can help me i will apreciate :confused:

romanhr,

Try this...

#!/usr/bin/perl -w
while (<*.txt>) {                                 #for each .txt file
   open (FH, "<$_") or die "Can't open file $_";  #  open file handle
   while (<FH>) {                                 #  while not end of file
      if ($. > 4) {                               #    if line number > 4 
         print $_;                                #       print full line incl. end of line char
      }
   }
   close (FH);                                    #  close file handle
}