I have a subtitle file, it looks like this:
00:00:44:" Myślę, więc jestem".|Kartezjusz, 1596-1650
00:01:01:Trzynaste Pietro
00:01:06:Podobno niewiedza uszczęśliwia.
00:01:10:Po raz pierwszy w życiu|zgadzam się z tym.
00:01:13:Wolałbym...
00:01:15:nigdy nie odkryć|tej straszliwej prawdy.
00:01:19:Teraz już wiem...
I'm not sure what format this is, but I wanted to convert the subtitles to .srt. Unfortunately gnome-subtitles
and subtitleeditor
can't recognize this kind of format.
gnome-subtitles
says:
Unable to detect the subtitle format. Please check that the file type
is supported.
subtitleeditor
says:
Please check that the file contains subtitles in a supported format.
file
output:
UTF-8 Unicode text
Is there a way to convert this file to .srt format?
Best Answer
This is very similar to @goldilock's approach but, IMO, simpler and can deal with empty lines in the file and replaces
|
with a line break :Save the script as a file and make it executable, then run:
The output I get on your sample was: