Skip to content

Instantly share code, notes, and snippets.

@shussekaido
Created September 30, 2013 16:10
Show Gist options
  • Save shussekaido/97f364ca316a15e80a7a to your computer and use it in GitHub Desktop.
Save shussekaido/97f364ca316a15e80a7a to your computer and use it in GitHub Desktop.
Creates plain text from SRT files by removing timecodes
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