Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 10905

How to extract part of a string between 2 delimiters, in Windows batch file?

$
0
0

I have a variable length string starting with START and ending with END as delimiters.

I want to extract the string between START and END.
I tried doing

SET _result=%String:~6,-4%ECHO %_result% 

Its removing the first 5 characters but not the last 3 characters as I want.

Suppose, _result=STARTblahblahblahEND
I am getting the output as blahblahblahEND

What I want is:

blahblahblah

Viewing all articles
Browse latest Browse all 10905

Trending Articles