Create: Update:
replace srt / vrt index numbers in subtitles...not really needed. In VSCode can simply do search for
This one removes the number starting at beginning of a line and appends a newline but that creates two newlines (two empty lines)
(^\d+\n)
and replace (nothing) ...but to do in a script is much harder it appears. Here's what I found after lots of searching.This one removes the number starting at beginning of a line and appends a newline but that creates two newlines (two empty lines)
sed -i 'N;s|^[0-9]\+||' test.vttNow to search for two empty lines and just remove one of them.
sed -i '/^$/{ :l N; s/^\n$//; t l p; d; }' test.vttSo I guess I'll just stick with the first method.
sed -i 'N;s|^[0-9]\+||' test.vttSo it went from 4.4MB down to 4.3MB so hmmm maybe not that much of a difference. Ok just did another one it went from 7.4MB to 6.8MB ..so it's a bit.
replace srt / vrt index numbers in subtitles...not really needed. In VSCode can simply do search for
This one removes the number starting at beginning of a line and appends a newline but that creates two newlines (two empty lines)
(^\d+\n)
and replace (nothing) ...but to do in a script is much harder it appears. Here's what I found after lots of searching.This one removes the number starting at beginning of a line and appends a newline but that creates two newlines (two empty lines)
sed -i 'N;s|^[0-9]\+||' test.vttNow to search for two empty lines and just remove one of them.
sed -i '/^$/{ :l N; s/^\n$//; t l p; d; }' test.vttSo I guess I'll just stick with the first method.
sed -i 'N;s|^[0-9]\+||' test.vttSo it went from 4.4MB down to 4.3MB so hmmm maybe not that much of a difference. Ok just did another one it went from 7.4MB to 6.8MB ..so it's a bit.
>>Click here to continue<<
GeekTips

