The first file is really big. The second file is about
200 MB with a single column (id). Yah, the script should extract records from file 1 that match an id in file 2. The second output should be a kind of statistics but is not important yet. I have about 32 GB of RAM and I would like to avoid the use of databases because I do not have any experiences with them.
So Im new to perl but Im able to read in the file Formats into perl but however for extraction of the ids I have no clue yet. Would be glad if you can help. May be the use of hash keys is the right Approach???
Code
#!/usr/bin/env perl
use strict;
use warnings;
#Variable
my $file1 = '/home/Desktop/file1.txt';
my $file2 = '/home/Desktop/file2.txt';
#Filehandle
open( my $FH , '<', $file1 ) or die "Couldn't open file \"$file1\": $!
+\n";
open( my $FH , '<', $file2 ) or die "Couldn't open file \"$file2\": $!
+\n";
#Program for comparison
my @file1_rows = split ("\t", $file1);
...
|