in reply to Re: merge multiple files giving out of memory error
in thread merge multiple files giving out of memory error
but please help me also to have the name of the files in which a particular read exists. I mean with the total count it also tells me in which files it is present.my %seen; $/ = ""; while (<>) { chomp; my ($key, $value) = split ('\t', $_); my @lines = split /\n/, $key; my $key1 = $lines[1]; $seen{$key1}[Key] //= $key; $seen{$key1}[Sum] += $value; } my $file_count = @ARGV; foreach my $key1 ( keys %seen ) { if ( @{ $seen{$key1} } >= $file_count) { print join( "\t", @{$seen{$key1}}); print "\n\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: merge multiple files giving out of memory error
by Eily (Monsignor) on Feb 27, 2017 at 12:31 UTC | |
by Anonymous Monk on Mar 02, 2017 at 09:01 UTC | |
by Eily (Monsignor) on Mar 02, 2017 at 09:17 UTC |