posted 8 years ago
I want to use the first column of each line in File 2 as a criteria to check if such line exist in file 1..if it does, change the last column in File 1 (yes, no) of such line to 'maybe'.
File 1
6130124,860847,9,9,4,9,e,6,2,S, yes
6150744,194559,7,7,4,9,e,6,2,S,no
6065543,511353,5,4,4,9,e,6,2,S,no
8419554,261221,6,6,2,18,a,7,1,S,yes
8190063,144544,5,5,2,18,a,7,1,S,no
8276868,285387,4,4,2,18,a,7,1,S,no
625541,233528,2,2,4,9,a,3,1,N,yes
676477,138280,2,2,4,9,a,3,1,N,no
628496,59404,2,2,4,9,a,3,1,N,no
File 2 ( a subset of File 1)
6130124,860847,9,9,4,9,e,6,2,S, yes
6150744,194559,7,7,4,9,e,6,2,S,no
8276868,285387,4,4,2,18,a,7,1,S,no
625541,233528,2,2,4,9,a,3,1,N,yes
That means...file 1 will be printed as :
6130124,860847,9,9,4,9,e,6,2,S, maybe
6150744,194559,7,7,4,9,e,6,2,S, maybe
6065543,511353,5,4,4,9,e,6,2,S,no
8419554,261221,6,6,2,18,a,7,1,S,yes
8190063,144544,5,5,2,18,a,7,1,S,no
8276868,285387,4,4,2,18,a,7,1,S,maybe
625541,233528,2,2,4,9,a,3,1,N,mabe
676477,138280,2,2,4,9,a,3,1,N,no
628496,59404,2,2,4,9,a,3,1,N,no
This is what I have done so far