in reply to Re: Deleting a columnheader
in thread Deleting a columnheader

It will make sure that I will have the columnheader of $FILE1. If I remove it, there will be no headers. I tried to replace that with this code:

my @columnheadings=split(/\t/,<$FILE1>); @columnheadings=@columnheadings[map{$_}(0..4)]; print $FILE4 "@columnheadings\n";

Then all the columnheaders were seen in the first cell when it was opened in spreadsheet.

Replies are listed 'Best First'.
Re^3: Deleting a columnheader
by choroba (Cardinal) on Oct 07, 2011 at 16:55 UTC
    You were almost there. Just join the array back. And note that map{$_}(0..4) is just the same as 0..4 itself, so you can write:
    print {$FILE4} join("\t", (split /\t/, <$FILE1>)[0 .. 4]),"\n";
      Thanks Choroba, It is perfect now.