Created
July 4, 2012 14:37
-
-
Save alpinskiy/3047690 to your computer and use it in GitHub Desktop.
Snippets to compare Windows Registry (version 5.0) *.reg files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Delete large binary data blocks | |
g/ \x\{2}\(,\x\{2}\)*\(,\\\)\=/ d | |
" Sort values inside [] sections | |
g/\[*\]\n\p/+1,/^$/-1 sort | |
" Join section [] content together with $ | |
g/\[*\]\n\p/,/^$/-1 s/$\n/ $ / | |
" Delete empty lines | |
%s/^$\n// | |
" Sort joined content | |
sort | |
" diff -a -u <first_file> <second_file> | |
" Extract changes from 1st file | |
g!/-\[.*\]/ d | |
" Extract changes from 2nd file | |
g!/+\[.*\]/ d | |
" Delete +/- at the begging of the line | |
%s/^[-+]\[/\[/ | |
" Expand joined [] section content | |
%s/ \$ $/\r/ | |
%s/ \$ /\r/g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment