I have a dos variable containing 7 email addresses separated by commas. I got another variable containing one email id of one of the email address in the above variable. I have to remove that email address from the 1st variable. Is there a script to do it without using 3rd party utilities..??
maybe like:
setlocal enabledelayedexpansion
:: %emails% like: a@xx.net,b@yy.net,c@zz.net
:: %rem% is like: b@yy.net
set emails=!emails:%rem%=!
set email=!emails:,,=,!
but you might have a , in front or trailing, depending on where it the list the removal occurs.
Hmm thanks.. That did work. Now lets see if i can delete the commas if i delete the first or last address. Thanks once again for the prompt reply.. :)
there's prob'ly a slick way to do it? but all i know is klunky:
(after substitution)
if "%emails:~0,1%" equ "," set emails=%emails:~1%
if "%emails:~-1%" equ "," set emails=%emails:~0,-1%
yippee problems solved.. ha ha.. now the script is working the way i need.. thanks guys.. thanks..
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |