C
clearguy02
Hi folks,
I have the following piece of code to compare two files: The first one
has list of all id's. The second has a list of both id's and places. I
need to compare the id's in the both lists. If the id in the first
file matches with the id in the second file, then the id in the first
file should be concatenated with the repspective place field (from the
second file) with a tab.
Here is the code:
++++++++++++++++++
open (IN1, "id1.txt") || die "Can not open the file: $!";
open (IN2, "id2_place.txt") || die "Can not open the file: $!";
while (<IN2>)
{
chomp;
my ($id2, $place) = (split(/\t/, $_))[0,1];
}
while (<IN1>)
{
chomp;
print "$_\t$place\n"
}
+++++++++++++++++++
I know there is some thing wrong in storing the $place value in the
first while loop.. what am I doing wrong here?
Thanks in advance,
J
I have the following piece of code to compare two files: The first one
has list of all id's. The second has a list of both id's and places. I
need to compare the id's in the both lists. If the id in the first
file matches with the id in the second file, then the id in the first
file should be concatenated with the repspective place field (from the
second file) with a tab.
Here is the code:
++++++++++++++++++
open (IN1, "id1.txt") || die "Can not open the file: $!";
open (IN2, "id2_place.txt") || die "Can not open the file: $!";
while (<IN2>)
{
chomp;
my ($id2, $place) = (split(/\t/, $_))[0,1];
}
while (<IN1>)
{
chomp;
print "$_\t$place\n"
}
+++++++++++++++++++
I know there is some thing wrong in storing the $place value in the
first while loop.. what am I doing wrong here?
Thanks in advance,
J