I was looking for a ROM renamer for Linux, and unfortunately there aren’t many options:

Since i could not find any tool meeting my needs, i’ve ended up writing my own in Python: renfromdats.

I’ve also added some extra features not found in other similar tools:

  • support for SFVs in addition to datfiles;
  • rename support files (saves, shots, etc.) by matching the filenames from 2 datfiles;
  • by default output on stdout a shell script to perform the renames.

This is the current cmdline usage:

usage: renfromdats.py [-h] [-r] [--include-roms] [--partial-matches]
                      [--recurse]
                      src_dat dst_dat [romdir [romdir ...]]

I’ve just made these bash functions to play with combinatorics from the commandline:

Example usages:

$ setintersection "1 2 3" "2 3"

['3', '2']

$ setproduct "1 2 3" "a b"

[('1', 'a'), ('1', 'b'), ('3', 'a'), ('3', 'b'), ('2', 'a'), ('2', 'b')]

$ permutations "1 2 3"

[('1', '2', '3'),
 ('1', '3', '2'),
 ('2', '1', '3'),
 ('2', '3', '1'),
 ('3', '1', '2'),
 ('3', '2', '1')]

$ powerset "1 2 3"

[(),
 ('1',),
 ('2',),
 ('3',),
 ('1', '2'),
 ('1', '3'),
 ('2', '3'),
 ('1', '2', '3')]

$ permutationspartial "1 2 3" 2

[('1', '2'), ('1', '3'), ('2', '1'), ('2', '3'), ('3', '1'), ('3', '2')]

$ combinations "1 2 3" 2

[('1', '2'), ('1', '3'), ('2', '3')]

Grab these functions and more from my macinit script.