Conversion of TXT into SRT file in subtitle
Thread poster: Ludo Prikler
Ludo Prikler
Ludo Prikler
Slovakia
Local time: 06:17
English to Slovak
Dec 20, 2009

Hi,
Is there anybody who had to convert txt into srt files in the subtitles? I created in Subtitle Workshop program the Spanish translation from English text. But when I wanted to use it in Word document - certain specific Spanish characters didn't appear properly. So I had to convert the file into UTF-8 or 16. This file was proofread, and I got from it my txt file again.
But there are some programs which work only with srt but not with txt files. So now I have to go backward and ma
... See more
Hi,
Is there anybody who had to convert txt into srt files in the subtitles? I created in Subtitle Workshop program the Spanish translation from English text. But when I wanted to use it in Word document - certain specific Spanish characters didn't appear properly. So I had to convert the file into UTF-8 or 16. This file was proofread, and I got from it my txt file again.
But there are some programs which work only with srt but not with txt files. So now I have to go backward and make from my proofread txt file again srt file. Here starts the problem - I don't know how. If I try to load this "converted" txt file to Subtitle Workshop - it doesn't appear properly at all! Once this part would work I could "save as" my txt in Subtitle Workshop as a srt file...

CAN SOMEONE HELP ME WITH THIS???
THANKS A LOT, Ludo


[Edited at 2009-12-20 17:57 GMT]

[Edited at 2009-12-21 10:00 GMT]
Collapse


 
FarkasAndras
FarkasAndras  Identity Verified
Local time: 06:17
English to Hungarian
+ ...
What did you do? Dec 21, 2009

Ludo Prikler wrote:

Hi,
Is there anybody who had to convert txt into srt files in the subtitles? I created in Subtitle Workshop program the Spanish translation from English text. But when I wanted to use it in Word document - certain specific Spanish characters didn't appear properly. So I had to convert the file into UTF-8 or 16. This file was proofread, and I got from it my txt file again.
But there are some programs which work only with srt but not with txt files. So now I have to go backward and make from my proofread txt file again srt file. Here starts the problem - I don't know how. If I try to load this "converted" txt file to Subtitle Workshop - it doesn't appear properly at all! Once this part would work I could "save as" my txt in Subtitle Workshop as a srt file...

CAN SOMEONE HELP ME WITH THIS???
THANKS A LOT, Ludo


The SRT is basically a TXT file with given specifications (timcode format etc.). If you didn't mess with these, all you need to do is open the TXT in a text editor and save it with the right encoding which will probably be ANSI (ISO 8859-1) and change the file extension back to .srt if you changed it.
Notepad in Windows, Gedit in linux and whatever the OSX text editor is should be fine for the job.


 
Ludo Prikler
Ludo Prikler
Slovakia
Local time: 06:17
English to Slovak
TOPIC STARTER
Thanks - Koszonom :) Dec 21, 2009

Hi dear Andras,

Thank you ver much for your answer. I go to try it how does it work. Wish you nice day.

...es a jo Isten aldast,
Ludo


 
FarkasAndras
FarkasAndras  Identity Verified
Local time: 06:17
English to Hungarian
+ ...
Szívesen Dec 21, 2009

I got a bit curious and looked it up:

"SubRip is the AVI of caption formats, in the sense that its basic functionality is supported everywhere but various people have tried to extend it in mostly incompatible ways and the result is a huge mess. SubRip (SRT) is a text-based format which can include font, size, and position information, as well as a limited set of HTML formatting tags, although most of these features are poorly supported. Its “official” specification is a doom9 fo
... See more
I got a bit curious and looked it up:

"SubRip is the AVI of caption formats, in the sense that its basic functionality is supported everywhere but various people have tried to extend it in mostly incompatible ways and the result is a huge mess. SubRip (SRT) is a text-based format which can include font, size, and position information, as well as a limited set of HTML formatting tags, although most of these features are poorly supported. Its “official” specification is a doom9 forum post from 2004. Most players assume that .srt files are encoded in Windows-1252 (what Windows programs frequently call “ANSI”), although some can detect and switch to UTF-8 encoding automatically."

This confirms that ANSI (=Win-1252=ISO8859-1 for all intents and purposes) is the most widely used and safest encoding.

The full specification from the quoted forum post, which you will probably not need:

The format has no header, and no footer. Each subtitle has four parts:

Line 1 is a sequential count of subtitles, starting with 1.

Line 2 is the start timecode, followed by the string " --> ", followed by the end timecode. Timecodes are in the format HH:MM:SS,MIL (hours, minutes, seconds, milliseconds). The end timecode can optionally be followed by display coordinates (example " X1:100 X2:600 Y1:050 Y2:100"). Without coordinates displayed, each line of the subtitle will be centered and the block will appear at the bottom of the screen.

Lines 3 onward are the text of the subtitle. New lines are indicated by new lines (i.e. there's no "\n" code). The only formatting accepted are the following:

Code:

<b>text</b>: put text in boldface
<i>text</i>: put text in italics
<u>text</u>: underline text
<font color="#00ff00">text</font>: apply green color formatting to the text (you can use the font tag only to change color)



Tags can be combined (and should be nested properly). Note that the SubRip code appears to prefer whole-line formatting (no underlining just one word in the middle of a line).

Finally, successive subtitles are separated from each other by blank lines.

Here is an example of an SRT file:

Code:

1
00:02:26,407 --> 00:02:31,356 X1:100 X2:100 Y1:100 Y2:100
<font color="#00ff00">Detta handlar om min storebrors</font>
<b><i><u>kriminella beteende och foersvinnade.</u></i></b>

2
00:02:31,567 --> 00:02:37,164
Vi talar inte laengre om Wade. Det aer
som om han aldrig hade existerat.








[Edited at 2009-12-21 12:23 GMT]
Collapse


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Conversion of TXT into SRT file in subtitle







Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »
Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »