Jump to content

Help with editing please


Pindiu

Recommended Posts

I have a set of 4 .srt files, and they all have extra numbers in each line that I need to edit out. e.g.

631
00:29:29,240 --> 00:29:31,760
Some text here.
632
632

632
00:29:31,800 --> 00:29:36,280
More text here.
633
633

Each number is there twice, and they are consecutive - +1 for each line.

Using Subtitle Edit, I can't seem to find a way to automatically delete them - Find & Replace doesn't work as each number is different.
I really don't want to have to edit each and every line - does anyone have any suggestions please?

Link to comment
Share on other sites

Hi. You need a program to remove duplicate lines. Try https://ibox.tools/remove-duplicates
If it removes spaces, then load the result into Subtitle Edit.
If that doesn't work, upload a sample subtitle here to try other ways.

 

P.S. I didn't see that forgetit had already suggested a better solution.

Edited by VelaOmsk
  • Like 1
Link to comment
Share on other sites

Thank you for your replies. Bedtime here now, so I'll try your methods tomorrow.

But I fear removing duplicates will only remove one of the numbers per subtitle line, not both. I need both to be gone.

Link to comment
Share on other sites

This might remove more than what you asked for, but could also work ?‍♂️: in Subtitle Edit, go to Edit -> Replace, put

^\d\d\d

into Find what: and leave Replace with blank. Select Regular expression (not something I'm particularly knowledgeable about) and replace all.

Then a Fix common errors with Remove unneeded spaces should get rid of the left over line breaks.

 

EDIT: that's also a pretty bad regex, TBH, because I don't know regexes. Maybe add a \d? to the end if it misses some

Edited by TestosteronnieFlex
  • Like 1
Link to comment
Share on other sites

These "line numbers" are part of a subtitle sequence.
That is, Subtitle Edit treats them as part of the text, not an actual new line, or more accurately, sequence.
I don't know if @VelaOmsk's suggestion works.
@forgetit's and @TestoteronnnieFlex's approaches won't work, I'm afraid.
@forgetit's suggestion to use notepad++ does remove one of the duplicates.

I know nothing about regex, but, for what I gather, in order to remove these duplicates one would require some code doing something like this:
"Remove all consecutive lines of text that contain only digits
up to the one that has as next line an empty one. (or back-to-back line breaks)"

 

  • Like 2

The chickens are revolting!

Link to comment
Share on other sites

Pindiu, you can give us the subtitles if they're not secret, we'll try what we can do.

Edited by VelaOmsk
  • Like 1
Link to comment
Share on other sites

47 minutes ago, forgetit said:

My regex works in notepad++. In subtitleedit it might work in the source view.

I was having only SE in mind, and failed to test notepad.
Thanx for the input, @forgetit.
And no, I tested both views, column and source, on SE.

The chickens are revolting!

Link to comment
Share on other sites

53 minutes ago, forgetit said:

My regex works in notepad++. In subtitleedit it might work in the source view.

Forgetit's method using notepad++ worked brilliantly.

Thank you all very much for the suggestions!  :smiley-signs101:

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Member Statistics

    27064
    Total Members
    6268
    Most Online
    deyvids63
    Newest Member
    deyvids63
    Joined
×
×
  • Create New...