This probably an easy question but I cannot find the answer. I recently found several loacations,where the batch file uses an unusual (to me) variable form.
The most recent is supposed to remove leadingbzeros from a variable. Can anyone explain what the following means?
Set n=000234765
Set n=%n:0=% <---- what is this and what does it do and how?
I know the common form of !n:~0,6! And similar but can find no explanation of n=%n:0=%
Thanks
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 3 of 3
Thread
-
-
By experimentation, it replaces all occurrences of the character sequence to the left of the = with the character sequence to the right of the = In this case all zeros are replaced with nothing. In the following the first "02" is replaced with "__"
Code:Set n=000234765 echo %n% Set n=%n:02=__% echo %n% pause
Last edited by jagabo; 21st May 2018 at 21:17.
-
@jagabo. Thank you much. I needed to replace zeros but couldn't for the life of me figure out how it worked or find reference to it except in the example i found. Thanks again.
Update. Once you let me know it 'replaces characters i went searching again and found a reference in case anyone reads and needs this in the future. Thanks again jagabo. Master of video as well as programming! Lol
https://ss64.com/nt/syntax-replace.htmlLast edited by Budman1; 21st May 2018 at 21:41.
Similar Threads
-
Should I start over again? (Video=Variable) (Audio=Variable Bitrate)
By strawberryshortcake in forum Newbie / General discussionsReplies: 5Last Post: 13th Feb 2018, 07:16 -
Multi bluray to mkv remux batch program
By Freak1 in forum Blu-ray RippingReplies: 6Last Post: 8th Dec 2014, 03:20 -
batch file: how to choose the variable that have value number lower?
By marcorocchini in forum Newbie / General discussionsReplies: 3Last Post: 30th Oct 2014, 10:51 -
DOS batch command variable
By sambat in forum ProgrammingReplies: 6Last Post: 24th Sep 2014, 13:14 -
Anyway to stop WMP streaming ID tags, or any program that could batch strip
By jethrouk in forum Newbie / General discussionsReplies: 5Last Post: 9th Dec 2013, 12:45