Thanks all,
Akshay, find and replace is working well, when I pass multiple inputs using while loop having concerns. The pattern lines are getting eliminated.
file
1,2,33,C,B
3,5,66,K,R
1,2,33,H,M
3,5,66,M,C
6,9,66,J,F
4,8,55,H,P
5,7,44,N,U
input.txt
66
55
CODE:
awk '{print $1}' input.txt | while read line
do
awk -F, '$5 = $3 == find ? replace : $5 ' OFS=, find=$line replace=77 file >>Output.txt
done<inputfile
Output.txt
1,2,33,H,M --->loop 1
4,8,55,H,P --->loop 1
5,7,44,N,U --->loop 1
1,2,33,C,B --->loop 2
3,5,66,K,R --->loop 2
1,2,33,H,M --->loop 2
3,5,66,M,C --->loop 2
6,9,66,J,F --->loop 2
5,7,44,N,U --->loop 2
And as we know it will append into the Output.txt file.
Is there a way to get the below output, when passing values in while loop?
1,2,33,C,B
3,5,66,K,77
1,2,33,H,M
3,5,66,M,77
6,9,66,J,77
4,8,55,H,77
5,7,44,N,U