A shell script for renaming numbered track files using associated names stored in a text file. Provides a simulation-mode (-s option) showing what would be done.
Track files' names (without extension) have to all match the same regular expression of the following list:
- "^[^0-9]*([0-9]+)$"
- "^([0-9]+)[^0-9]*$"
Track list files have to contain lines that (after whitespace twimming) match the regular expression "^([0-9]+)[ \t;.-]+(.+)$". Track list files may start with a multi-line header of wich no line may look like an entry.
Resulting names are constructed as number + " - " + name where the number is left-zero-padded to match the string length of the greatest track file number.
Detected errors:
- Track file numbering not starting at 1 or containing gaps
- Track files' names containing duplicate numbers
- Track files are not stored in the same directory
- Track list entry numbering not starting at 1 or containing gaps
- Track list not containing exactly one entry for every Track file
Requires:
- Python 3
Usage:
- tracksRename (-s) tracklistpath trackfilepath (trackfilepath)..