Someone had asked me if they knew of a way to get .srt in to a more readable format like a word document and also an excel formatted sheet – it was something they needed to do with a large number of subtitle files. I instantly thought of Filemaker, (if I had had more time I would probably of done a nice fancy regex (regular expressions) file, but I didn’t) so using all very native commands I created a conversion process – and it only took me about 30 mins all in all.
.srt files are formatted like this:
1
00:00:17,794 –> 00:00:22,160
“Some of the biggest men in the United States,
in the Field of commerce and manufacture are afraid of something.2
00:00:23,873 –> 00:00:28,707
They know that there is a power somewhere so organized,
so subtle, so watchful, so interlocked, so complete, so pervasive,3
00:00:30,765 –> 00:00:39,936
that they better not speak above their breath when they speak in condemnation of it.”
~Woodrow Wilson, former President of the United States
So the basic structure is:
Subtitle number ID
Start time –> End time
Text of subtitle (one or more lines)
Blank line
This looked simple enough and so I got to work.
First thing to sort out was the fields needed. I decided to setup a global field to contain the .srt text and a number field to indicate which line I would like to display on top of that I then needed 2 calculation fields to create the start and end points of the text for the specific subtitle number ID. Then finally 3 fields needed to be created to display start time, end time and text in separate fields.
Using these the plan was to setup a loop which would go through from 1 up to however big the last subtitle number ID was in the .srt text – creating a new record for each and extract just the text needed and adding it to the previous ID extraction in another global field (of course the loop would simply exit when the calculated text field was empty i.e. end of file).
At the end you would end up with X records all with the relevant start time, end time and specific text in separate fields (which can be exported to excel) and a global field which can then be copied and pasted in to another application with the full text from all the IDs.
There were a few things extra I added to these which I saw from the examples files I was given – that was the use of ” and ~ these were used to start some of the text as quotes and the ~ was used to show who the quote was from. For these I added extra paragraph returns so the text was to some extent better arranged to read.
The open file is below – just remember to toggle the ” and ~ option if you use it with other .srt files that don’t follow this formatting. Also note that once you have run this process it will automatically export a csv file to your desktop and open it.
Let me know how you would of chosen to do this and any bugs you find? Thanks
Pingback: Websites tagged "filemaker" on Postsaver
Is it possible that each text line stays in the line?
Like:
7
00:00:36,603 –> 00:00:38,605
I thought you were gonna wake me at 6:30.
8
00:00:38,605 –> 00:00:40,106
I also said women like men
9
00:00:40,106 –> 00:00:41,608
who are shaped like potatoes.
becomes:
I thought you were gonna wake me at 6:30.
I also said women like men
who are shaped like potatoes.
thx!!
@Ivo Ivic – yep download the file again. Now has an option to add a paragraph return.
Hi there,
it works perfectly. Is it possible to put it in a new row only after a fullstop or question mark appeares.
Like:
2
00:00:15,081 –> 00:00:16,082
Mmm, do you think
3
00:00:16,082 –> 00:00:18,585
normal people pack suitcases this way?
4
00:00:18,585 –> 00:00:20,587
I’m an engineer, not a normal person.
5
00:00:20,587 –> 00:00:21,588
That’s a lot of clothes
6
00:00:21,588 –> 00:00:23,590
just to visit a sweatshop in Elbonia.
becomes:
Mmm, do you think normal people pack suitcases this way?
I’m an engineer, not a normal person.
That’s a lot of clothes just to visit a sweatshop in Elbonia.
Thanks!
Ivo
i can’t extract srt in chinese, it’s a subtitle of a chinese movie….
can’t extract ……….could you help please??
Dear Simon, first of all thank you very much for your application. I’m writing my thesis on subtitles among TV series (lost, fringe, flashforward, …) and I need to build my corpus of vocabulary. Your app is my panacea because I have to change my srt subtitles in plain .txt But I can’t manage to use fp7 files? Please, have you got a compiled version of your great FILEMAKER?
Thank you very much, I enjoyed A LOT your pictures too!!! ;)
It works perfectly, thank you so much.
After I’ve corrected half of a film by hand in 2 weeks, I’ve noticed about your program and It works perfect! Thank you very much!
But I think It must start from 1st sentence or sth. But my srt files takes 2300 lines but after 1200 lines program stops. After this can I start from 1201?
It sounds great, I was after the very same task with a srt file. But I’d appreciate any further explanation. What is supposed I have to do? Do install File Maker app to? Which version would be appropriate? any? That’s is not easily affordable. Perhaps the trial one? So what’s nature is your file extraxt-srt-data.fp7? a FM DB template? Even so how-to do it (I’m no user to FM app).
Well, Big thanks anyway =/
Hi Simon!
I wanted to do this to study foreign movies more easily. I’m sure your solution works and that File Maker is a great program, but for people who don’t own File Maker there may be an easier way. Import the .srt file as text to a column of Excel. Using a simple VBA subroutine the unwanted lines (rows) with timings and/or numbers can be eliminated. Transferring the result to Word you can produce as required a nice (usually long) text document.
Cheers, Steve
I found a way (somewhat long-winded, but it works) of converting a .srt file to an Excel file on Subtitle Edit (open source).
I have explained how here:
http://www.translationengland.com/1/post/2014/01/how-to-export-subtitle-edit-subtitle-files-into-microsoft-excel.html
Hey there, Simon, please be patient with a slow person, I see the file, downloaded but don’t know how to use it. I need to convert subtitles to plain text. Could you be so kind explaining a little bit the steps? :) Thanks, Shuby
Oh, hey, I’ve found an easier way :)
Install on your computer Subtitle Workshop – subtitles editing software. Run the program. Open your subtitles file (“File” -> “Load subtitle…”). Then you will have to convert it to custom format. To do that choose “File” -> “Save as…”. In the opened window click on “Custom format” (button below). In the next window delete the text in the right text field (it starts with “** Copyright © 2002 URUSoft”). In the same text field paste the following lines:
{RepeatSub}
{swText}
{EndRepeat}
Click on “Save!” button. Enter the file name you want and click “Save”. That’s it!