this works:
set "$VAR=^!$VAR:*¦=^!"
this doesn't:
set "$VAR=^!$VAR:*==^!"
this works again:
for /f "tokens=1,2* delims==" %%a in ( 'set $VAR' ) do echo.tokens=%%b_ %\n2%
Is it possible to make it work without for ?
set "$VAR=^!$VAR:*==^!" not working
Moderator: DosItHelp
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: set "$VAR=^!$VAR:*==^!" not working
Ok so in the above I was trying it in a macro but I can't even make it work outside a macro, even this don't work:
set "$?=hello=there"
set $var=%$?:*==%
echo.$var=%$var%_
pause
exit
result:
==%
not expected at this time.
neither does this:
set $var=%$?:*^==% rem this evaluates to set "$var=hello=there"
or this:
set $var=%$?:*=^=%
set "$?=hello=there"
set $var=%$?:*==%
echo.$var=%$var%_
pause
exit
result:
==%
not expected at this time.
neither does this:
set $var=%$?:*^==% rem this evaluates to set "$var=hello=there"
or this:
set $var=%$?:*=^=%
Re: set "$VAR=^!$VAR:*==^!" not working
I have problem with this script if any one of you people have the solution are welcome
In this below script i want that script after substracting 1 from day the day should desplay the result in double figure like 01..........09. this work fine when today date is in double figure. Sorry for my poor english.
SETLOCAL
REM *********** SET Value from DATE *************
set yy=%date:~-4%
set dd=%date:~-7,2%
set mm=%date:~-10,2%
set /a dd =%dd%-1
cd\
e:
cd e:\Archived-Repo\%yy%-%mm%-%dd%
My personal id is ziauktk84@yahoo.com any suggestion from any body are welcome
In this below script i want that script after substracting 1 from day the day should desplay the result in double figure like 01..........09. this work fine when today date is in double figure. Sorry for my poor english.
SETLOCAL
REM *********** SET Value from DATE *************
set yy=%date:~-4%
set dd=%date:~-7,2%
set mm=%date:~-10,2%
set /a dd =%dd%-1
cd\
e:
cd e:\Archived-Repo\%yy%-%mm%-%dd%
My personal id is ziauktk84@yahoo.com any suggestion from any body are welcome
Re: set "$VAR=^!$VAR:*==^!" not working
Hi Ed,
Isn't this a special case relevant to How to replace "=","*", ":" in a variable - a topic you already visited?
Your FOR solution will not give the correct answer for a string like "part1==part2". The correct answer is "=part2" and the FOR technique returns "part2". I think a variation of what amel27 does in the above link could be developed to give the exact solution.
One other suggestion - We are still learning the ins and outs of macros, and they are not used by the general audience. So before posting questions related to macro development code, you should probably see if the question can be distilled to its fundamentals without any unnecessary macro "baggage". In this case you managed to do that by your 2nd post. (It sounds like I don't like macros - but you know I do!)
Dave Benham
Isn't this a special case relevant to How to replace "=","*", ":" in a variable - a topic you already visited?
Your FOR solution will not give the correct answer for a string like "part1==part2". The correct answer is "=part2" and the FOR technique returns "part2". I think a variation of what amel27 does in the above link could be developed to give the exact solution.
One other suggestion - We are still learning the ins and outs of macros, and they are not used by the general audience. So before posting questions related to macro development code, you should probably see if the question can be distilled to its fundamentals without any unnecessary macro "baggage". In this case you managed to do that by your 2nd post. (It sounds like I don't like macros - but you know I do!)
Dave Benham
Re: set "$VAR=^!$VAR:*==^!" not working
Hmmm, I understand it know, ... guess I owe u again