FILES=*.srt for f in $FILES # Script changes SRT numbers formula: # last three digits of six-digit decimal are removed # decimal is replaced by a comma # Dependencies: Sed # Tested to work with Mac only. # usage: # 1) cd to directories with files + script # 2) enter path/to/script.sh # N.B. make sure file names have no space and that script is executable ( chmod +x path/to/script.sh ) # Joseph Polizzotto, Access Technology Specialist Instructor (HTCTU) 408-996-6044 do # extension="${f##*.}" filename="${f%.*}" echo "Correcting timestamp formulas in $f" # last three digits of six-digit decimal are removed sed -ri 's/([0-9]+\.[0-9]{3})[0-9]+/\1/g' $f # decimal is replaced by a comma sed -ri '/[0-9]\./s/\./,/g' $f done