Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have educational videos that I am trying to burn to a DVD using Bombono DVD along with their corresponding subtitles. The subitles (.srt files) have the following format:

1 00:00:00,000 --> 00:00:02,000 In the video where we introduced the atom, I went

2 00:00:02,000 --> 00:00:06,000 off a bit about how at the center of an atom we have the

3 00:00:06,000 --> 00:00:09,000 nucleus, and it's actually a very small fraction of the

etc.

However, there are quite a few errors in the subtitles in which the time for a line is zero seconds. For example:

81 00:03:37,000 --> 00:03:37,000 a little bit faster.

When the DVD authoring software finds these lines, it cancels the entire DVD burning process. I can find out which line caused the error, but then I have to start the burn again before I know where the next one is.

My question is whether it is possible to create a script which will search all of the subtitles files and find all instances of repetition on a single line if I don't know what the exact string is that is repeated. Essentially, is it possible to show every line that has 12 characters repeat without specifying what those characters are (since they are different in every instance?)

Thanks for your help.

share|improve this question

1 Answer 1

awk '$2 == $4 {print NR ":" $0}' filename

will output all the offending lines with the line number.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.