Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.lang.shell.batch.winnt > #5

Re: Making Filenames Mirror One Another With Different Extensions

From Zaidy036 <Zaidy036@air.isp.spam>
Newsgroups alt.comp.editors.batch, alt.comp.lang.shell.batch.enhancements, alt.comp.lang.shell.batch.msdos, alt.comp.lang.shell.batch.winnt, alt.msdos.batch, alt.msdos.batch.nt
Subject Re: Making Filenames Mirror One Another With Different Extensions
Date 2022-01-10 17:42 -0500
Organization A noiseless patient Spider
Message-ID <sricoh$gnp$1@dont-email.me> (permalink)
References <MPG.3105cfae4be44d7598c10a@news.eternal-september.org>

Cross-posted to 6 groups.

Show all headers | View raw


On 1/17/2016 5:20 PM, 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.
> 
Substitution works for you:

SET Title="House.S08E18.Body And Soul.mkv"
SET Title2="%Title:~0,-3%srt
    then
Echo Title2
    gives
House.S08E18.Body And Soul.srt

Back to alt.comp.lang.shell.batch.winnt | PreviousPrevious in thread | Find similar


Thread

Making Filenames Mirror One Another With Different Extensions AlleyCat <al@aohell.com> - 2016-01-17 16:20 -0600
  Re: Making Filenames Mirror One Another With Different Extensions JJ <jj4public@vfemail.net> - 2016-01-18 22:39 +0700
    Re: Making Filenames Mirror One Another With Different Extensions AlleyCat <al@aohell.com> - 2016-01-18 16:26 -0600
  Re: Making Filenames Mirror One Another With Different Extensions Zaidy036 <Zaidy036@air.isp.spam> - 2022-01-10 17:42 -0500

csiph-web