Re: Making Filenames Mirror One Another With Different Extensions

From: AlleyCat ([email protected])


On Mon, 18 Jan 2016 22:39:59 +0700, JJ says...

>
> On Sun, 17 Jan 2016 16:20:39 -0600, AlleyCat wrote:
> > Hello all. I think this will be simple for you batch and script gurus, but
> > it's driving me crazy.
> >
> > Videofile: House.S08E18.Body And Soul.mkv
> >
> > Subtitle: House.S08E18.HDTV.XviD-LOL.srt
> >
> > If you please... copy text after third period (or whatever will be before
> > the extension in other cases) of videofile and copy it to the srt file, so
> > both files are identical other than the extension.
> >
> > Sample: House.S08E18.Body And Soul.mkv
> > House.S08E18.Body And Soul.srt
> >
> > Not all vid files are in this "format", but I'll work on it from there.
> >
> > Thank you so very much.
>
> It's pretty complicated considering the format can be anything. Try below
> code. Use code from the pastebin link if your news client always split long
> lines.
>
> <http://pastebin.com/4Ajrgiak>;
>
> The code relies heavily on the well known episode numbering format "SxxEyy".
> It must be in the proper numbers. e.g. no season/episode zero. It assumes
> that the text before that is the video title. It'll use both as a prefix
> with period or a space separator based file naming. Text after the episode
> are ignored. If two or more video files matched, only the first one is used.
>
> e.g. for these files:
>
> House S08E18 Body And Soul.mkv
> House.S08E18.HDTV.XviD-LOL.srt
> House.S08E18.Body And Soul.H264-LMAO.mkv
> House.S08E18.HDTV.XviD-LOL.srt
>
> The srt will be renamed as:
>
> House S08E18 Body And Soul.srt
>
> The actual REN command in the batch file is disabled. It simply show the REN
> command line that should be executed.

Wow... thank you very much!

Share |