@@ -0,0 +1,885 @@
+#!/usr/bin/python3%0Aimport fileinput%0Aimport re%0A%0Afilenames = %5B'mem-00-header.xml', 'mem-01-b.xml', 'mem-02-ch.xml', 'mem-03-D.xml', 'mem-04-gh.xml', 'mem-05-H.xml', 'mem-06-j.xml', 'mem-07-l.xml', 'mem-08-m.xml', 'mem-09-n.xml', 'mem-10-ng.xml', 'mem-11-p.xml', 'mem-12-q.xml', 'mem-13-Q.xml', 'mem-14-r.xml', 'mem-15-S.xml', 'mem-16-t.xml', 'mem-17-tlh.xml', 'mem-18-v.xml', 'mem-19-w.xml', 'mem-20-y.xml', 'mem-21-a.xml', 'mem-22-e.xml', 'mem-23-I.xml', 'mem-24-o.xml', 'mem-25-u.xml', 'mem-26-footer.xml', 'mem-27-non-canon.xml'%5D%0A%0Abase_id = 10000;%0Afor filename in filenames:%0A    id = base_id%0A    with fileinput.FileInput(filename, inplace=True, backup='.bak') as file:%0A        for line in file:%0A            (line, num_subs) = re.subn(r%22_id%5C%22%3E(%5Cd+)%3C%22, %22_id%5C%22%3E%25s%3C%22 %25 id, line)%0A            print(line, end='')%0A            if num_subs != 0:%0A                id += 10%0A    base_id += 10000;%0A

add renumbering script