#!/usr/bin/perl -w while(<>) { chomp; print "#define $1 0x$2\n" while(/(OFFSET_\w+):?\s+([0-9a-f]+)/g); }