Without using the diff option.
I have two different CSV files (I know what is the names of the columns headlines)- old.csv and new.csv. they are with a different number of rows and columns. the CSV files can include numbers, strings, chars, and special characters. For example:
old.csv
round date first second third fourth fifth sixth 1 2 2021.04 2 45e69 10 16 4565 37 2 3 2021.04 4 15 456as df924 35 4N320 4 5 2021.03 4 43!d9 23 26 29 33 new.csv
round date first second third fourth fifth sixth 0 1 2021.04 1 14 15 24 40 41 1 2 2021.04 2 45e69 10 16 4565 37 2 3 2021.04 4 15 456as df924 35 4N320 3 4 2021.03 10 11 20 21 24325 41 5 6 2021.03 4321 9 2#@6 28 34350 41 Line 1 and 2 from both CSV are the same.
Now, I want to print out the difference between new.csv compared to old.csv. I want to print out only the new lines in new.csv file. like that:
result.csv
round date first second third fourth fifth sixth 0 1 2021.04 1 14 15 24 40 41 3 4 2021.03 10 11 20 21 24325 41 5 6 2021.03 4321 9 2#@6 28 34350 41 Counting the lines was for easier reading. I want the headline columns will be kept in the result.csv file.
The option I think that might help here is using keywords. For example, comparing the two CSV files by columns "first" and "fifth"- if one of the columns is not the same, print that in the result.csv file.