Iam sorry if my first post confused a bit...
Ok here is what iam doing...
** COBOL Program which extracts information from database to flat file with ! as delimiter...
** My perl programs reads the flat file and should convert it to CSV file based on value at Col 17( contains clients names)
** one CSV file per client
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