in reply to Re^5: how to check if a particular value exist in list of files stored in an array
in thread how to check if a particular value exist in list of files stored in an array
The code which i used is taking more time to check each file and print the line to output file
As each file contains millions of records, taking field1 from the condition file and searching all the files in @filelist, the files may be 1...........100, the size of each file is in GB
foreach my $file_name (@array) { open FILE, "$file_name" or die "File not exists"; while ( my $line = <FILE> ) { my ( $field1, $field2 ) = split /\,/, $line; if (exists $records{$field1}) { $field_2 = $records{$field1}; if( $field2 eq $field_2 ) { print OUTPUT $line; } } } }
Please help on this
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: how to check if a particular value exist in list of files stored in an array
by hdb (Monsignor) on Oct 30, 2013 at 08:59 UTC | |
by Perlseeker_1 (Acolyte) on Oct 30, 2013 at 11:04 UTC | |
by Corion (Patriarch) on Oct 30, 2013 at 11:12 UTC | |
by Perlseeker_1 (Acolyte) on Oct 30, 2013 at 17:28 UTC |