Actually I posted this question before. But I did not know how to put my question back to the comments I got. So I am putting it here.
I have a csv file
File name : input_file.csv
I have mentioned field1, field2 just for understanding that the file has 2 fields.
In the above file field1 and field2 are the columns in a csv file.
just for understanding, a1 is the first value in line1 in field1(column) and b1 is field2(column) value in line1 respectively.
I am looking for a matching criteria below:
By looking we can say that b1,b2,b3 are values in filed2(column) which are not found in field1(column). So I need print these not matched values of field2 in field1 to a output file. Probably I think I need help on looping foreach . Like every value in if ($field1 ne $field2) which should be looped to get the resulting set. If I can get help in completing the code it would be great.
I have framed the condition with ne for not matching case
$source_file = 'C:\\input_file.csv';
open (FH, $source_file) || die ("Could not open $source_file!");
while ($line = <FH>)
($field1,$field2) = split ',', $line;
print "$field1, $field2\n";
if ($field2 ne $field1)
# need help for looping all values in field2 to chek with all values with field1