0

I want to remove the timecode from an .srt file so I can just copy and paste the text into a document. Is there a way to achieve this without manually deleting each line?

S3 4.1.1

verve
  • 1,035
  • 14
  • 32
  • 51
  • You might wish to check for an editor app which supports Search-and-Replace by RegExps. – Izzy Aug 28 '13 at 18:58
  • @Izzy: But how would that work? I don't want to replace but I'm looking for something that can strip a .srt file of it's timecodes just to be left with words. – verve Aug 29 '13 at 00:37
  • Sure: Replacing the timecode with "nothing" would be the same as removing/stripping it, right? See geffchang's answer: His command removes lines consisting of nothing but digits. ^ is start of line, $ is end of line, and [0-9]+ means "one or more of the characters from 0 to 9". / is the delimiter, and d says to delete. For the curly braces and the N you need to ask geffchang, I never saw that notation. – Izzy Aug 29 '13 at 06:02

2 Answers2

1

I'm going to provide a suggestion, but it's not an Android app.

You can try subeditnet:

A simple tool to add or remove time to a SRT subtitle file. I developed this in my spare time, so don't expect it to be completely bug free. Please always BACKUP your .srt file ;)

You will need Microsoft .NET Framework 3.5 to execute it on older Operating Systems.

Or via Linux command (not tested):

$ dos2unix subtitles.srt
$ sed -r '/^[0-9]+$/{N;d}' subtitles.srt > outfile

geffchang
  • 17,565
  • 18
  • 57
  • 73
  • Why is it not Android related? I need to do this on my phone hence the question. – verve Aug 29 '13 at 03:05
  • @verve In that case, it is Android-related, but so far I haven't found anything that will do what you want. Windows apps may be your best bet for now. – geffchang Aug 29 '13 at 03:23
  • Assuming the linux command is correct, you just need to install busybox and a terminal emulator from the play store. It's also possible that dos2unix and sed are already available (without busybox) but you may need to do some extra work to find the right path to the tools. You'll also need to make sure you have write permission for the correct location. – Velociraptors Aug 29 '13 at 03:50
0

As explained it the comments to the question, and indicated by geffchang's answer, what you need for that is an editor supporting regular expression search and replace. An example for such is Jota+ Text Editor, supporting that for Android 2.2 onwards.

To learn more about Regular Expressions, see this Wikipedia article, which also provides additional links. To teach them would go beyond the scope of this site, but the examples given might already work out for you.

Izzy
  • 91,166
  • 73
  • 343
  • 943