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
Post a Comment