DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: SrtFix 1.1  (Read 5,195 times)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
SrtFix 1.1
« on: June 16, 2010, 06:59 AM »
I don't know how common this is, but I ran into an .srt subtitle file that would not load in any player or even subtitle program.  Somehow all the commas ',' in the time lines milliseconds were replaced with periods '.'.

I'm not big with regular expression search and replace. It was just faster to write an AutoIt3 program in case this should pop up again.

It simply reads the .srt file listed on the command line, substitutes ',' for '.' found on even lines, and writes it back out to filename.srt.fixed.  The original is not altered.

Usage: SrtFix filename.srt

You can download it here:

http://www.favessoft.com/downloads.html

« Last Edit: June 21, 2010, 12:51 AM by MilesAhead »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: SrtFix 1.0
« Reply #1 on: June 21, 2010, 12:31 AM »
SrtFix has been removed due to brain cramp.

If it worked it was by accident.

Sorry about that. Use a real srt fix utility from someplace.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: SrtFix 1.1
« Reply #2 on: June 21, 2010, 12:54 AM »
SrtFix 1.1 has been posted.  You can download using the link in the top post.
The "brain cramp" was that 1.0 assumed checking for periods in even numbered lines would work, when that just happened to be so because the particular subtitle file had all "one liner" subtitles.

Version 1.1 now checks each line for "-->" which indicates the subtitle time interval.  On those lines if it finds a period '.' it will change it to a comma ','
to fix the milliseconds section of the time code.

That's all it does.  But when you get an .srt that won't load it's easy not to notice those commas are really periods, unless you look closely.

Original address: https://www.donationcoder.com/forum/index.php?topic=23107.0