in reply to Re: Obtaining header from file (first line) - printing to output file
in thread Obtaining header from file (first line) - printing to output file

Sorry, I was vague on your problem. You want to print the forst line to a file, then do some additional processing. You could put the print statement in the section that tests for $x == 1. (You could have used the file line number variable, $. instead of $x. $. starts with 1 to the end.)
if ($x==1) { print OUTFILE $line, "\n"; (@keys)=split(/\t/, $line); } else { my $y=0; (@holder) = split(/\t/, $line); my %hash; for my $column (@holder) {

Replies are listed 'Best First'.
Re^3: Obtaining header from file (first line) - printing to output file
by dkhalfe (Acolyte) on Jul 17, 2012 at 02:06 UTC
    Thanks, Ill give it a try tomorrow and let you know how all goes!
      This worked perfectly. Appreciate the help!