Created
September 30, 2013 16:10
-
-
Save shussekaido/97f364ca316a15e80a7a to your computer and use it in GitHub Desktop.
Creates plain text from SRT files by removing timecodes
This file contains hidden or 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
To simply remove timecodes (this is a long command that should be on one line): | |
cat episode01.srt | |
|cat "$@"|tr -d '\r' | |
|grep -v '^[0-9]*$' | |
|grep -v '^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9] --> [0-9]' | |
> episode01.txt | |
To remove timecodes and linebreaks: | |
cat episode01.srt | |
|cat "$@"|tr -d '\r' | |
|grep -v '^[0-9]*$' | |
|grep -v '^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9] --> [0-9]' | |
|tr -d '\n' | |
> episode01.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment