Simple diff/patch script for sorted unique file -


how write simple diff resp. patch script applying additions , deletions list of lines in file?

this original file (it sorted , each line unique):

a b d 

a simple patch file (or somehow simple):

+ c + e - b 

the resulting file should (or in other order, since sort applied anyways):

a c d e 

the normal patch formats can not used since include context, might alter in case.

since nobody give me answer, i've created small python script, job. https://github.com/white-gecko/simplepatch

to apply such patch call (where outfile.txt generated)

./simplepatch.py -m patch -i infile.txt -p patchfile.txt -o outfile.txt 

to generate patch/diff call (where patchfile.txt generated)

./simplepatch.py -m diff -i infile.txt -o outfile.txt -p patchfile.txt 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -