Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Deleting a columnheader

by bluray (Sexton)
on Oct 07, 2011 at 16:51 UTC ( [id://930216]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://930216]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found