in reply to Re^2: opening many files
in thread opening many files
@ARGV = glob 'datafile*'; open my $OUTPUT, '>', 'output_file' or die "Cannot open 'output_file' +because: $!"; my %data; while ( <> ) { next unless /^(.+) (\S+)$/; push @{ $data{ $1 } }, $2; } for my $key ( sort keys %data ) { print join ' ', $key, @{ $data{ $key } }, scalar @{ $data{ $key } +}, "columns\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: opening many files
by wanttoprogram (Novice) on Feb 28, 2012 at 04:44 UTC | |
by Anonymous Monk on Feb 28, 2012 at 05:08 UTC | |
by wanttoprogram (Novice) on Feb 28, 2012 at 16:35 UTC | |
by Anonymous Monk on Feb 29, 2012 at 08:16 UTC | |
|
Re^4: opening many files
by wanttoprogram (Novice) on Feb 28, 2012 at 16:32 UTC |