I'm struggling to write a regular expression for the multiple expression function in Subtitle Edit
What I want to do is select all one line subtitles (ie does not contain \N) and add "\N \N" at the end of the line making them 2 lines.
This forces the subtitle to display the single or top line always in the same y position in the player I'm using.
Subs will never be more than 2 lines
Thanks in advance for any help.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 6 of 6
Thread
-
Last edited by ChocOrange; 22nd Jun 2023 at 15:55.
-
Try this awk command assuming that your subtitle file is named sub.srt
Code:awk " /\134n/{ print $0} !/\134n/{print $0\"\134n\134n\"}" sub.srt
-
Thanks but it doesn't work as subtitle files are in the format: (it also makes every line just '\n\n')
Code:1 00:00:22,875 --> 00:00:24,250 <i>Yes?</i> 2 00:00:25,333 --> 00:00:26,958 I'll be right there. 3 00:00:42,875 --> 00:00:47,000 <i>Imagine a world without information.</i>
Subtitle edit reformats in the editor as per my request.
I'd prefer a solution that works in SE.Last edited by ChocOrange; 22nd Jun 2023 at 12:33.
-
I was going to revise my script to exclude all lines that start with a numeral. But since you desire a solution that works in SE, I will take my leave.
-
Found a way in Subtitle edit in case anyone else needs it.
Edit | Modify Selection. Use the 'Rule' drop down and choose 'Exactly one line'
Right click on a selected line and choose 'Selected Lines > Multiple Replace' (There's no option in the standard Multiple Replace to apply only to selected lines).
Use a replace of Regular expression Find: $ Replace \N \N
Similar Threads
-
How to hide codes like <br/> />, etc. in subtitle file in subtitle edit?
By Pusat in forum SubtitleReplies: 0Last Post: 10th May 2023, 01:34 -
Adjusting SUP subtitle positions in Subtitle Edit
By CWCprime in forum SubtitleReplies: 3Last Post: 31st Jul 2020, 02:51 -
Subtitle edit, warning subtitle contains negative timing codes fix please
By jraju in forum Newbie / General discussionsReplies: 1Last Post: 16th Dec 2019, 18:52 -
This dummy can't sync subs with Subtitle Edit or Subtitle Workshop :-(
By inspector_plodder in forum SubtitleReplies: 6Last Post: 24th Aug 2018, 18:33 -
Pixelated and laggy video on Subtitle Workshop and Subtitle Edit
By Valerc in forum SubtitleReplies: 5Last Post: 15th Jul 2018, 11:37