i want to compare and obtain new data of 2 files, but the place of the content changes lines

24 Views Asked by At

lest say i have 2 files with the following content:

file1.txt

1- cat
2- dog
3- fish
4- lion

and the file 2:

file2.txt
1- fish
2- lion
3- "new data"
4- cat
5-dog

with the methods that I have used, they always interpret the change of line of the content as "new data" even if it is not., how can I ignore that and only obtain the new data?

I took a look at the difflib python library but couldn't find anything that refers to that specifically.

0

There are 0 best solutions below