I am trying to copy string line from file2 to file1, if this line is not exist in file1. I am using symmetric_difference but it gives me unordered result. Content of files in this example is not actual. There is no numbers in my actual files, just strings, but I used numbers to show the problem. I could probably add numbers to file 2 and sort it as list, but file 2 randomly getting information from other program, that I am not familiar with, and don't want to interfere.
content of file1:
'1\n','2\n','3\n'
content of file2:
'1\n','2\n','3\n','4\n'`,'5\n','6\n','7\n','8\n','9\n','10\n'
it's just string on every line
diff = set(file1).symmetric_difference(file2)
set(['8\n', '10\n', '9\n', '6\n', '7\n', '4\n', '5\n'])
My goal is
set(['4\n', '5\n', '6\n', '7\n', '8\n', '9\n', '10\n'])