If you got a lot of ill-named files like:
$ ls S01E03.The.Sopranos.S01E03.Denial.Anger.Acceptance.avi The.Sopranos.1x04.Meadowlands.avi The.Sopranos.S01E01.The.Sopranos.avi The.Sopranos.S01E02.46.Long.avi The.Sopranos.S01E06.Pax.Soprana.avi The_Sopranos.105.College.avi
that your divx player can’t sort properly and you want to end up with something like:
$ ls 1x01.avi 1x02.avi 1x03.avi 1x04.avi 1x05.avi 1x06.avi
you can use the following script in this way:
cd /path/to/avi/files
../script.sh|sh
and if you want to do the same thing to srt files then:
cd /path/to/srt/files
../script.sh srt|sh
As an example the script will normalize any of the following patterns S01E03, 103,1×03, or just 03 to 1×03.
The contents of script.sh are:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
The script is also available as a gist