In both of my files cty_id is the key column where i would be searching by putting the cty_id number. For eg if i search for cty_id 001 then i should get below results
city_id 001 doest have any mismatch
if 002
Mismatch at col grade_val : Null - 41
if 003
Mismatch at col g_val : Null - 1
Like wise i need to compare based on the columns from two files and there can be mismatches in other columns for the same city_id's but need to compare only the columns which are present in both files.
I tried with below code but not able to get through
echo Please enter your cty_id:
read id
while read id; do grep "$id" file.csv; done < file_1.csv
What i would require is to compare the files based on the columns and extract the mismatches in below format if i input city_id.
For eg if i give 001 as input it will search in both files because the files will have only one record with 001 and compare column by column the values if they have any mismatch in column