ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

SrtStrip 1.3.4.0

(1/2) > >>

MilesAhead:
Someone on another board requested a program to strip those Italic and other angle bracket tags from .srt subtitle files(e.g. <i>some dialog between</i>)

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

SrtStrip 1.0

It's command line based. It's only designed to remove those one character
open and close tags(e.g. <x> and </x>.)

See the Readme.txt for particulars.

There are other ways to remove the tags, such as using an editor, but the person requesting the command line app had several hundreds or even thousands of sub files and loading one at a time would be a chore.  With this utility, you can process all the .srt files in a folder by opening a command prompt in that folder and running this command line:

for %s in (*.srt) do SrtStrip %s

for each filename.srt you'll get an output file named filename.srt.strip

Since every now and then I run into subs where the italic tags just show on screen
I thought I'd knock it off.

I tried using sed but to get that Linux streaming edit stuff to work on Windows you really need to set up bash or another shell.  Otherwise it takes longer to figure out how to work around the incompatibilities than to just program it from scratch. For a one-off it's not worth it.

Anyway, for what it does, it seems to work pretty well. It's just rudimentary. No real error checking.  It checks to see if the output file already exists in the current folder, and if so, deletes it before processing the input.

edit: since it's command line based, no gui for screen shot, but here's the program icon. :)


MilesAhead:
SrtStrip 1.1 I improved the regular expression replace(not my forte) so that the substitution for each line is a single pass.  Latest is on my site for download.

It's just a simple compiled AHK script.  Here's the source in case you need to filter out additional tag types:


--- ---
#NoEnv
#NoTrayIcon
SendMode Input

If 0 < 1
{
MsgBox, 64, SrtStrip Usage, SrtStrip Copyright (c) 2010 www.FavesSoft.com`n`nUsage: SrtStrip filename.srt`n`nOutput is subtitle filename.srt.strip stripped of <> tags
ExitApp
}

InFile := %0%
OutFile := InFile . ".strip"
 IfExist,%OutFile%
    FileDelete,%OutFile%

Loop, read, %InFile%,%OutFile%
{
    result := RegExReplace(A_LoopReadLine,"</?.>")
FileAppend,%result%`n
}

MilesAhead:
SrtStrip 1.2 is available for download via the link in the first post. I've added removal of tags that use an opening and closing curly brace on a line such as {a6}. Anything that opens with a '{' and ends with a '}' on the same line will be removed from the output copy. As before the output filename is the input filename with ".strip" appended.

The input file is not altered.

MilesAhead:
SrtStrip 1.31 SrtStrip has been updated.  Changes:

1) if the input file is named subs.srt the output file will be named subs_strip.srt  rather than the old way of tacking on .strip as another extension. This gets rid of the Explorer warning dialog when renaming the output file and changing the extension back to .srt.

2) Angle bracket tag removal was limited to single character tags such as italics.  Now any tag beginning with a less than bracket and ending with a greater than bracket on the same line will be removed. One example would be font size setting tags.

edit: same version number. I uploaded a new zip that contains source,exe,readme, and custom icon.

MilesAhead:
SrtStrip 1.32 Now filters out filenames with "_strip.srt" on the end.  This avoids reading the output files as input. This could happen if used with the For command on the command line, as in:  For %s in (*.srt) do SrtStrip %s

Conceivably one of the filename_strip.srt output files could get sucked back in as input. :)
Now the app just quits if this is detected.

I could change it to use an input and output folder without changing the filename but to be honest it's not the type of app that gets much use.  Just good to have in cases where the .srt file is full of Italic tags.  :)

Navigation

[0] Message Index

[#] Next page

Go to full version