PDA

View Full Version : Batch edit idx/sub files


Knocks
16th February 2009, 12:24
I have about 50 idx/sub subtitles, and I need to insert a 20 sec delay at the beginning of each one. What is the easiest way to go about this?

unskinnyboy
15th March 2009, 04:37
You'll need to insert the line delay: -0:0:20:0 (if that doesn't work, try delay: -00:00:20:00 - I forget which is the right syntax) in between the # Vob/Cell ID line and the first timestamp line, and if you need this for all the languages in the idx/sub file, you'll need to do this for each language.

Here is one way to do that:

Open all 50 idx files in Notepad++ (make backups of them, just in case!).
Go to any one idx file, and do Ctrl+H to bring up the Find/Replace window.
In the Find what box enter # Vob/Cell ID: 1, 1 (PTS: 0) and in the Replace with box, enter # Vob/Cell ID: 1, 1 (PTS: 0)\ndelay: -0:0:20:0, and set the Search mode to Extended.
Now press the button Replace all in all open documents.
Press Ctrl+Shift+S to save them all.
Done.

All changed idx files should now look something like:

# English
id: en, index: 0
# Decomment next line to activate alternative name in DirectVobSub / Windows Media Player 6.x
# alt: English
# Vob/Cell ID: 1, 1 (PTS: 0)
delay: -0:0:20:0
timestamp: 00:02:52:138, filepos: 000000000
timestamp: 00:02:54:307, filepos: 000001000