There are 2 files named compare 1.txt and compare2.txt having random numbers in non-sequential order
cat compare1.txt
57
11
13
3
889
014
91
cat compare2.txt
003
889
13
14
57
12
90
Aim
Output list of all the numbers which are present in compare1 but not in compare 2 and vice versa
If any number has zero in its prefix, ignore zeros while comparing ( basically the absolute value of number must be different to be treated as a mismatch ) Example - 3 should be considered matching with 003 and 014 should be considered matching with 14, 008 with 8 etc
Note - It is not necessary that matching must necessarily happen on the same line. A number present in the first line in compare1 should be considered matched even if that same number is present on other than the first line in compare2
Expected output
90
91
12
11
PS ( I don't necessarily need this exact order in expected output, just these 4 numbers in any order would do )
What I tried?
Obviously I didn't have hopes of getting the second condition correct, I tried only fulfilling the first condition but couldn't get correct results. I had tried these commands
grep -Fxv -f compare1.txt compare2.txt && grep -Fxv -f compare2.txt compare1.txt
cat compare1.txt compare2.txt | sort |uniq
Edit - A Python solution is also fine