This is the content of my input file(rpm.txt).
U25,1007
U27,1269
I would like my code to use this file (rpm.txt) as input, change directory to U25, and search for 1007 in U25/test.csv, and print all columns in test.csv that match 1007; and repeat for every line.
This is the code for this, without the loop:
cat U25/test.csv | awk -F ',' '$1 == 1007 {print $0}' > x
cat U27/test.csv | awk -F ',' '$1 == 1269 {print $0}' >> x
Would anyone be able to help me write this as a loop?
{print $0}as that is whatawkdoes by default anyway.