in reply to Re: Splicing Arrays on pre-defined indices
in thread Splicing Arrays on pre-defined indices
my %filehash = (); while (<>){ @pline = split (/\!/,$_); my $keycolumn = $pline[15]; # based on this col values split files unless ($filehash{$keycolumn}){ $filehash{$keycolumn}{name} = $pline[15]; open $filehash{$keycolumn}{handle},">$filehash{$keycolumn}{n +ame}; # open distinct file handles for each distinct value found in c +ol 15 } print {$filehash{$keycolumn}{handle}} @pline; } # In the above code iam considering all col's , but my new requirement + is , for some rows i should only some predifined col's which can 1, +3,5,6,7 i.e. i need slice these indices from @pline before writing it + into corresponding file
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Splicing Arrays on pre-defined indices
by harishnuti (Beadle) on Jun 27, 2008 at 18:01 UTC | |
by BrowserUk (Patriarch) on Jun 27, 2008 at 18:15 UTC |