python - How to output difference between two text files? -


i'm wondering how can compare 2 text files, highlighting difference between each of them? example:

file1.txt

aaaaa bbbbb ccccc 

file2.txt

aaaaa bbbbb 

i'd have following output after comparison of 2 files:

ccccc 

i'm using python, , tried sed , grep no luck (i'm interested in linux shell ways of doing too).

sort file1.txt file2.txt | uniq -u 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -