I have constructed a script which compares four arrays:
First array consists of publication dates of books from reading lists - approx. 2000 values in total
Second array consists of Titles of books from reading lists - approx. 2000 values in total
Third array consists of publication dates of books from catalogue - approx. 83,000 values in total
Fourth array consists of Titles of books from catalogue - approx. 83,000 values in total
The purpose of the script is to compare the values of 2000 book-titles & 2000 publication-dates with 83,000 book-titles and 83,000 publication dates. If publication-dates and book-titles match then it is printed on the screen. Ultimately, I am trying to find which books contained in reading list are contained in the catalogue as well.
---
here is my script:
----
my @readingbooks = ("a b", "c d", "e f", "g h");
my @readingdate = (1991, 1992, 1993, 1994);
my @catbooks = ("one", "two", "three", "client's", "five", "six", "seven", "eight", "a b");
my @catdate = (1980, 1981, 1982, 1994, 1984, 1985, 1986, 1987, 1991);
my $rdbooks; my $rddate; my $cataloguebooks; my $cataloguedate;
for (0..$#readingbooks){
$rdbooks = $readingbooks$_;
$rddate = $readingdate$_;
for (0..$#catbooks){
$cataloguebooks = $catbooks$_;
$cataloguedate = $catdate$_;
if (($rdbooks eq $cataloguebooks) && ($rddate == $cataloguedate)) {
print "$rdbooks \t $cataloguebooks \n";
print "$rddate \t $cataloguedate \n";
print "wow \n\n";
}
}
}
The problem in when I run a small set of data this script works fine, but when I actually run it with the complete data of 2000 to compare with 83,000 then it doesn't work. Can anyone please help what am I doing wrong here, or what process i need to adopt for making it work?
thanks in advance for your time and help!
--
Vani
In reply to How to work with Arrays of 83,000 values by vaniaul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |