Created
October 21, 2013 12:49
-
-
Save gvieira/7083365 to your computer and use it in GitHub Desktop.
Adjust str encoding and rename it according to movie name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set encoding to UTF-8 | |
for f in *.srt; do iconv -f `file --mime-encoding -b "$f"` -t UTF-8 "$f" > "$f.u"; mv "$f.u" "$f"; done | |
# Rename according to movie | |
ls *.srt | while read f; do n=`grep -o 'S..E..' <<< "$f"`; m=`ls -1 *"$n"* | grep -v "\.srt$"`; o=${m%.*}; mv "$f" "$o.srt"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment