I have a lot of video files with the following syntax:
SXEY is not constant.
Y are numbers depending on the file. I would like to rename them to
TV Show Title - SXEY - Episode Title.mkv
In order to do that I use the
rename command as the following oneliner:
rename 's/\./\ -\ /;s/\./\ -\ /;s/\.(?!mkv)/\ /g;s/1080p.*(?=\.mkv)//g' *.mkv
The command first transforms the first two dots into
␣-␣, then transforms all the other dots into whitespaces and finally removes everything between the end of the episode title and the file extension.
Any idea to improve it? I suppose there is a way to transform the first two dots with only one regex.
rename is a GNU utility and therefore is not present on all Unix systems, I am looking for a more portable alternative.