O
omurice
Hi,..
I meant to compare lines like this in two files
$set1;
$set2;
$varline1;
$varline2;
$i = 0;
$j = 0;
foreach my $line (@file2Arr) {
$line2 = @file2Arr;
foreach my $line (@file1Arr){
$line1 = @file1Arr[j];
if (line1 is similar to line2){
$set1 = $j + 1; #file1 line number
$set2 = $i + 1; #file2 line number
...
do things;
...
$varline1 = $set1;
$varline2 = $set2;
last;
}
else{
$j++;
}
}#end of foreach j
$i++;
}#end of foreach i
I can get out of foreach j loop when match is found and proceed to the
next i,..but how do I get the j loop to start again from the index
where match is last found + 1
So for example, if match is found on file1 line 4 and file2 line 1
($i=0, $j=3), I'd like to start the next looping with $i = 1, and $j =
4
Help me pleeeeaseeeee!!!!!!!
Thaaaaanksssss
I meant to compare lines like this in two files
$set1;
$set2;
$varline1;
$varline2;
$i = 0;
$j = 0;
foreach my $line (@file2Arr) {
$line2 = @file2Arr;
foreach my $line (@file1Arr){
$line1 = @file1Arr[j];
if (line1 is similar to line2){
$set1 = $j + 1; #file1 line number
$set2 = $i + 1; #file2 line number
...
do things;
...
$varline1 = $set1;
$varline2 = $set2;
last;
}
else{
$j++;
}
}#end of foreach j
$i++;
}#end of foreach i
I can get out of foreach j loop when match is found and proceed to the
next i,..but how do I get the j loop to start again from the index
where match is last found + 1
So for example, if match is found on file1 line 4 and file2 line 1
($i=0, $j=3), I'd like to start the next looping with $i = 1, and $j =
4
Help me pleeeeaseeeee!!!!!!!
Thaaaaanksssss