Created
April 7, 2018 08:34
-
-
Save jmgz4e9/ab8139728a83103878aac71768959907 to your computer and use it in GitHub Desktop.
strip HI from srt
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
<foo.srt tr '[]' '{}'\ | |
| dos2unix | |
| awk -f srt-strip-HI.awk | |
| tr '{}' '[]' |
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
/^[0-9]+/ { body = body "\n" $0; next } | |
/^<[^>]+>\r?$/ { body = ""; next } | |
/^[:space:]*$/ { next } | |
1 { print body; print $0; body = "" } |
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
BEGIN { ctr = 0 } | |
/^[0-9]+$/ { next } | |
/^[0-9][0-9]:/ { line2 = $0; next } | |
/^\{[^\}]+\}\r?$/ { next } | |
/^[:space:]*$/ { next } | |
1 { print ""; print ++ctr; print line2; print $0; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment