Need to remove the last word from the URL in batch file

February 24, 2012 at 05:09:37
Specs: Windows XP
Hi,I am writing a batch file for svn trunk merge.
I need to remove the last word from the svn URL,which is needed as a variable in my batch file.
Example of what i need as follows:

URL=http://svnpath.co.in/repos/web/trunk/india/state/city/region/mumbai.html

I need the result as follows

RESULT= http://svnpath.co.in/repos/web/trun...

I have searched and tried many thing but doesn't get any specific result.
Please provide the batch code that will remove the last word/file name
Thanks in advance


See More: Need to remove the last word from the URL in batch file

Report •


#1
February 24, 2012 at 08:29:02
if it is always the same length, you could use / as a token and remove it with a for statement?

mike


Report •

#2
February 25, 2012 at 14:21:56
I have use the / delims but in my case,I just want to remove the last file name or last folder name from the URL.
Please help me to remove this.
Ex.URL=http://svnpath.co.in/repos/web/trunk/india/state/city/region/mumbai.html

I need the result as follows

Reuslt=http://svnpath.co.in/repos/web/trunk/india/state/city/region

or

URL=http://svnpath.co.in/repos/web/trunk/india/state/city/region

I need the result as follows

Reuslt=http://svnpath.co.in/repos/web/trunk/india/state/city

please provide the code that will perform the above process.


Report •
Related Solutions


Ask Question