Hi Folks -
I have a variable called %MAINPATH% which is the following:
SET MAINPATH=C:\Hyperion_Batch\
What I need to do is strip the first 3 characters (C:\) and replace the last (\) with /. Can this be done in 1 fell swoop? Thanks!
Strip first 3 characters and replace the last?
Moderator: DosItHelp
Re: Strip first 3 characters and replace the last?
Think about what you can do with the for variable modifiers or even just using the slash as a delimiter.
Re: Strip first 3 characters and replace the last?
Yes
set mainpath=%mainpath:~3,-1%/
set mainpath=%mainpath:~3,-1%/