I have 2 csv files whose contents are-
104,p1,no 102,p2,yes 104,p10,no 110,su11,no
expo1.csv is a file on the server, and
impo1.csv is a file I created to update
expo1.csv. A script makes the changes in
expo1.csv as specified in
impo1.csv after performing slight processing in the impo1 data (eg. The line 102,p2,yes from
impo1.csv is processed and then an update is made to
expo1.csv after changes:
Now after the script makes the changes, we need to validate if the changes are done properly by comparing the impo1 and expo1 files. This is where i'm stuck.
So far I could isolate the data between the commas in
impo1.csv separately into variables using
Sno=104 102 104 Posw=p1 p2 p10 cho=no yes no
Now the question is, how do I check this? The
impo1.csv files contains around 3000 updates.
grep p1 expo1.csv|grep no expo1.csv, obviously it will not return the correct result as the file has many 'no' strings. I have tried using a for loop to separate the data using
awk into separate variables and then grep using a wildcard -
grep sno expo1.csv|grep '/<$posw.*,$cho>/' expo1.csv - but it doesn't work.
Using GNU bash 4.1.2.
EDIT - Should have mentioned this earlier, my bad - There are no clear patterns in the impo1.csv file which I can use to check the expo1 file. I have made corrections to the sample file contents which illustrate my point.