nuxx.net
Making, baking, and (un-)breaking things in Southeast Michigan.

Merging .reg Files

Do any of you have a good way to merge .REG files together?

I’ve got four files and I want them to all become one. Key values don’t need to be merged, the lines can simply be duplicated if they are different. I just need to slam four files together and get rid of the duplicate lines.

4 Responses

  1. entropicdude February 13, 2008

    they’re text files.. can’t you just use standard tools to concat them them remove duplicates?

    1. Not really. They are more like INI files, where each section contains subsections. Duplicates need to be deleted in those subsections, but not throughout the files overall.

  2. http://www.winmerge.org/

    It might be tedious, and I’m not sure how well it will handle registries, but for any structured text file (code, HTML, XML, etc.) having WinMerge around is just about ideal.

    1. I ended up just doing it with Notepad++. I had four files which were exports of HKLM\Software\Policies\WindowsFirewall and I needed to merge them. There were only four large sections which really needed work (the rest were all the same), so I just pasted each of the four together, then used cut, sort, and uniq to trim them down to something usable. Since some of them had typos resulting in almost-but-not-quite duplicates, grep and just looking at the files sorted out the rest.

Leave a reply