Hi,
I have one column of strings in 1st file file and another file which consists of 5 clumns in each line and my basic objective is to find each item/line of 1st file is available in 3rd column of 2 nd file.
And I tried the following logic. It might be bit round about way but as a beginner am trying as follows.
The column in the 1st file is having data as example
The 2nd file data is as follows:
My logic is as follows:
I am opening the 1st file in an array and for each item I am opening the second file and scanning through each line and checking whether the array content is equal to $V[2] of second file. The logic seems to work even though the search is taking time.
But I considered
as a string literal and my if loop is as below:
But it does not seem to work. Anything wrong in considering the data as string literal or when I read the file contents in an array, anymore maniputaion is wrong with string comparison? Please let me know. Regards
I have one column of strings in 1st file file and another file which consists of 5 clumns in each line and my basic objective is to find each item/line of 1st file is available in 3rd column of 2 nd file.
And I tried the following logic. It might be bit round about way but as a beginner am trying as follows.
The column in the 1st file is having data as example
Code:
NS008_456_R0030_3008
Code:
+ test NS008_456_R0030_3008 67 223
I am opening the 1st file in an array and for each item I am opening the second file and scanning through each line and checking whether the array content is equal to $V[2] of second file. The logic seems to work even though the search is taking time.
But I considered
Code:
NS008_456_R0030_3008
Code:
if($rawdata[0] eq $v[2]) {
do something here
}
Comment