in reply to Re: File Manipulation - Need Advise!
in thread File Manipulation - Need Advise!
To use it as is, call the script with "file2.txt" as parameter on the command line, and redirect the script's STDOUT to "file1.txt".my %data; my $header = <>; # first line while(<>) { my($key) = split /\t/; $data{$key} = $_; } # output: print $header; foreach my $key (sort keys %data) { print $data{$key}; }
perl thescript.pl file2.txt >file1.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: File Manipulation - Need Advise!
by nashkab (Novice) on Jan 03, 2008 at 18:23 UTC | |
by bart (Canon) on Jan 03, 2008 at 18:32 UTC | |
by nashkab (Novice) on Jan 03, 2008 at 18:55 UTC | |
by blue_cowdawg (Monsignor) on Jan 03, 2008 at 19:03 UTC |