I have a situation like this. I have a list of urls in a file.
SET str1="http://www.domain.com/dir1/dir2/dir3/dir4/dir5/file1.txt"
In the above string http://www.domain.com/dir1/dir2/dir3
is constant in all the urls.
I need to extract the rest of the path in each url.
I mean, i need to get the final string from the above url is /dir4/dir5/file1.txt
Thanks
You need the %var:~start,end%
notation. For example, if you run this:
@SET str1="http://www.domain.com/dir1/dir2/dir3/dir4/dir5/file1.txt"
@ECHO %str1:~37,-1%
It will print /dir4/dir5/file1.txt
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With