# Usage: $0 regedit-export-file.reg # Take said export file and converts to a list of killbits. require 'iconv' $/ = "\x0d\x00\x0a\x00" # for pre-conv chomp @lastline = '' @killbit = '^"Compatibility Flags"=dword:00000400$' while line = gets line_a = Iconv.conv('ASCII', 'UNICODE', line.chomp) + "\n" if line_a =~ /#{@killbit}/ puts @lastline.split(/[\x7b\x7d]/)[1] # easier than real gsub.. end @lastline = line_a if(line_a !~ /AlternateCLSID/) # Ignore these lines end