Hi all,
Newb here - I'm looking for help coding an automatic renamer script which will remove the source/codec/group from commonly downloaded tv files. For example, I'd like the script to change:
minute.to.win.it.s02e38.hdtv.xvid-qcf.avi TO minute.to.win.it.s02e38.avi
House.S07E22.HDTV.x264-DIMENSION.mkv TO House.S07E22.mkv
Basically this applies only to TV shows so all I want it to search for "hdtv", and remove that until the period before the file extension. Any tips? Thanks in advance!
[Bash/Linux] Help with Rename script
Re: [Bash/Linux] Help with Rename script
Use sed to replace stuff.
pseudocode:
#$1 is inputfile (or directory)
filename=$(basename $1)
extension=${filename##*.}
newname=echo $filename | sed 's/.xvid.*\|.x264.*//g'
mv $filename $newname.$extension
pseudocode:
#$1 is inputfile (or directory)
filename=$(basename $1)
extension=${filename##*.}
newname=echo $filename | sed 's/.xvid.*\|.x264.*//g'
mv $filename $newname.$extension
Re: [Bash/Linux] Help with Rename script
Thanks for your help