Need numbers going up on every blank line followed by a previous line break for subtitles
-
(Before)
00:03:26,487 --> 00:03:28,448
Do you mind the radio?00:03:29,198 --> 00:03:30,717
Do you want me to turn the radio off?00:19:07,990 --> 00:19:10,367
Okay. Be a good girl.
Get out and go home.(After)
1
00:03:26,487 --> 00:03:28,448
Do you mind the radio?2
00:03:29,198 --> 00:03:30,717
Do you want me to turn the radio off?3
00:19:07,990 --> 00:19:10,367
Okay. Be a good girl.
Get out and go home. -
search/replace doesn’t have a way of counting, so it’s more complicated than some questions.
If you have the PythonScript plugin, you could write a script that would do it.
However, if you are willing to do a multi-step process, what I might suggest is:
- Search/Replace: FIND =
\R(?!\d{2}:\d{2}:\d{2})
REPLACE =☺
SEARCH MODE = regular expression, REPLACE ALL => this will turn your data into00:03:26,487 --> 00:03:28,448☺Do you mind the radio?☺ 00:03:29,198 --> 00:03:30,717☺Do you want me to turn the radio off?☺ 00:19:07,990 --> 00:19:10,367☺Okay. Be a good girl.☺Get out and go home.☺ ...
- Insert a smiley at the beginning of each line: FIND =
^
REPLACE =☺
SEARCH MODE = regular expression, REPLACE ALL - Use Column Select mode to select the zero-width first column. The standard way of doing a column select is
Alt
+ Click-and-drag… but if your file is long (and I assume it is), you will want an alternate:this post describes a way to accomplish it:- Click in the upper-left corner of the modified document
- Edit > Begin/End Select
Ctrl+End
to get to the end of the documentAlt+leftClick
to the left of the first character on the last line- You should now have a column selection to the left of the first column of data:
- ⦿ Edit > Column Editor
- Number to Insert
- Initial Number:
1
- Increase By:
1
- Convert the smilies back to newlines: FIND =
☺
REPLACE =\r\n
SEARCH MODE = regular expression, REPLACE ALL =>
Hope this helps
—
PS: If you find yourself often wanting to be able to do the begin/end selection in column mode, you can make a macro following instructions in this linked post - Search/Replace: FIND =
-
@PeterJones said in Need numbers going up on every blank line followed by a previous line break for subtitles:
⦿ Edit > Column Editor
Number to Insert
Initial Number: 1
Increase By: 1Convert the smilies back to newlines: FIND = ☺ REPLACE = \r\n SEARCH MODE = regular expression, REPLACE ALL =>
Awesome, thank you very much! worked like a charm except for step 3 part 2-4.
Scrolling down to the last line before the first character then holding Shift + Alt did the trick. -
@Clayton-Lewis said in Need numbers going up on every blank line followed by a previous line break for subtitles:
except for step 3 part 2-4.
You are right. After 3.4, I should have said another Begin/End Selection. Sorry. But yes, what you described is equivalent.