Hi,
Does anyone know how I can add an empty line underneath every line of my files? The idea is to have the subtitles appear slightly higher on the screen when I play my files on my blu-ray player, and this is the only way I found to do it (outside of remuxing the video files).
I looked for a way to do that with subtitle edit, and batch convert the files, but I can't find a way.
+ Reply to Thread
Results 1 to 18 of 18
-
-
This seems to work. The space between the control characters (\n) is a hard space.
You get it by typing Alt+032 on your keyboard.
I did the following with a text editor. No idea how using Subtitle Edit.
video.srt
Code:1 00:00:02,440 --> 00:00:8,640 This is a single line of text. \n \n 2 00:00:10,640 --> 00:00:16,760 This is a wrapped line of text. Well, it will be when I've typed in enough words. Are we there yet? \n \n 3 00:00:18,760 --> 00:00:21,240 I've started yet another line. Who's an eccentric? \n \n 4 00:00:23,400 --> 00:00:27,640 Now the text should have dropped back to the original position.. 5 00:00:31,400 --> 00:00:33,640 I hope this helps you.
Cheers. -
I found you can also do it like this.
Code:1 00:00:02,440 --> 00:00:8,640 This is a single line of text.\n \n 2 00:00:10,640 --> 00:00:16,760 This is a wrapped line of text. Well, it will be when I've typed in enough words. Are we there yet?\n \n 3 00:00:18,760 --> 00:00:21,240 I've started yet another line. Who's an eccentric?\n \n 4 00:00:23,400 --> 00:00:27,640 Now the text should have dropped back to the original position.. 5 00:00:31,400 --> 00:00:33,640 I hope this helps you.
-
Yes, it seems to be working, thank you!
Now if anyone knows how to add that underneath every single line, using Subtitle Edit or another program, that'd be great
Edit: The first way works, the second one doesn't seem to.Last edited by Nico Darko; 14th Jan 2023 at 20:01.
-
Now if anyone knows how to add that underneath every single line, using Subtitle Edit or another program, that'd be great
Code:awk "!/^[A-Z]/{print } /^[A-Z]/{ print $0\"\n\134n\134n\" }" video.srt
where video.srt is the subtitle file -
Thanks, but it's not working properly. A lot of the lines turn like this:
It'll give me focus, help
\n \n
increase my resources.
Some lines are like this:
How's my favourite chess partner?
\n \n
Still leading with your knight?
\n \n
Plans? We planned plans?
\n \n -
Most srt renders will "display" this as a blank line (html itallics tags with a space between them):
<i> </i> -
this will work provided the sub title text starts with the letters A to Z or a to z.
Code:awk "/^[A-Z,a-z]/ { c = 2 } --c == 0 { print \"\134n\134n\" } {print $0}" video.srt
Code:awk "/^[A-Z,a-z]/ { c = 2 } --c == 0 { print \"\074i\076 \074/i\076\" } {print $0}" video.srt
-
Great, thank you, it's working. But is there a way to change the code for when the line starts with the symbol " and - ?
Also I've been able to see the result by adding "pause" at the end, but I don't see how to save the new srt file? -
This should do the trick.
Code modifies text that start with uppercase, lowercase, comma, quotation and minus. Modified file is saved to video_modified.srt
Code:awk "/^[\042A-Z,a-z-]/ { c = 2 } --c == 0 { print \"\074i\076 \074/i\076\" } {print $0}" video.srt > video_modified.srt
-
-
using a loop ... need to copy this code and save as whatever.cmd and place in appropriate folder (where all your .srt files are stored).
Run the script from the same folder (very important). The resultant modified file will have the same name as original but with the word 'new' added
Code:for %%f in (*.srt) do ( awk "/^[\042A-Z,a-z-]/ { x++; c = 2 } --c == 0 { print \"\074i\076 \074/i\076\" } {print $0}" %%f > %%~nf_new.srt )
-
I've just realized that awk doesn't work if the name of the subtitle file has any space in it. Is there a way around that? because I have a bunch of files that have spaces in their name.
-
Nothing to do with awk. It's a standard command line issue -- space is a demarker between arguments. Put double quotes around the filenames.
Code:... "%%f" > "%%~nf_new.srt"
Similar Threads
-
Divide each line of text into new subtitle line
By martanius in forum SubtitleReplies: 1Last Post: 11th Apr 2021, 16:21 -
Reliable method for inserting an empty line? (Subtitle Edit)
By Asterra in forum SubtitleReplies: 3Last Post: 18th Feb 2021, 15:34 -
Command line to add audio to mkv files
By Nico Darko in forum Video ConversionReplies: 25Last Post: 12th Jul 2020, 21:27 -
How to add a new line with same text to multiple subtitle at once?
By zyck in forum SubtitleReplies: 7Last Post: 19th Apr 2020, 08:01 -
How to add moving line in video?
By SinghLive in forum EditingReplies: 4Last Post: 6th Dec 2019, 15:10