script to remove time codes from srt file

Project:Linux software
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Related pages:#5365: Removing formatting from srt files
Description

I'd like a script to remove time codes from srt file.

What is available?

Comments

#1

This one liner does it:

cat subtitles.srt | tr '\n' '\t' | sed 's/\t\t/\n/g' | sed 's/[0-9]*\t//1' | sed 's/^[^\t]*\t//' | sed 's/\t-/\n-/' | sed 's/\t/ /g' | sed 's/ / /g' | sed 's/^-//' | sed 's/^ *//' | sed 's/<[ib]>//' | sed 's/<\/[ib]>//' > dialogues.txt

TODO:
package into a script,
add to code repository,
create distribution packaging.