Youtube subtitles

Hello. I am new to Keyboard Maestro and was wondering if there was a way to do this. Youtube can generate automatic subtitles like this

0:00:23.670,0:00:26.160
up on me so it's okay don't worry about

0:00:25.830,0:00:27.960
it

0:00:26.160,0:00:29.910
Michael and I did see each other through

0:00:27.960,0:00:32.219
some difficult times and actually what's

and I was wondering if there was a way to make it into a document where the sentences were written out without the numbers so like Keyboard Maestro would make it look like this

"up on me so it's okay don't worry about it Michael and I did see each other through some difficult times and actually what's"

The numbered lines would be deleted, the blank line would be deleted and it would read as just a sentence straight through.

Thanks

Sure. You can use a Search and Replace action with a regular expression to remove all lines not containing a letter. Say something like this:

  • Search & Replace with Regular Expression “(?m)^[^a-z]*^” with “”
  • Filter with Unwrap

The regular expression “(?m)^[^a-z]*^” breaks down as:

  • (?m) - flag to say that it is multi-line text, which makes the ^ match at the start of any line
  • ^ - match at the start of the text or the start of any line
  • [^a-z]* any sequence of zero or more characters, none of which are letters
  • ^ - match at the start of the text or the start of any line

So it will match your time stamp, and match a blank line, but any line with letters in it will not be matched.

2 Likes

Edited to say, this worked. Surprise surprise it was user error on my part. thanks Peter

1 Like