I've made an application that compares two similar textfiles line for line, then write an output of both the lines if they are different;
aaaaaaaaaaaaaa <-> aaaaaaaaaaaaaa
bbbbbbbbbbbbbb <-> bbbbbbbbbbbbbb
cccccccccccccccc <-> cccccccccccccccx -> ccccccccccccccccc
zzzzzzzzzzzzzzzz <-> zzzzzzzzzzzzzzzz
The thing is that this won't work if somewhere in one of the files a line has been added, in which case I need only this line to be written, and then the process resynchronized on the next similar line. There can be several instances of added lines after eachother, in numerous instances of the file, but mainly the two files will contain large chunks where the lines are equal. How do I solve this problem?