How to extract a substring after a

March 9, 2009 at 09:08:45
Specs: Windows XP

I have a string "Hello World" in my text file. How can i get the World part of the string in a variable in batch file.

Thanks for your help inadvance

See More: How to extract a substring after a

Report •

March 9, 2009 at 09:47:19
@echo off & setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in (myfile) do (
set str=%%a
set str=!str:Hello World=World!
if !str! equ World (
set var=!str!
echo var is !var!

If at first you don't succeed, you're about average.


Report •

March 10, 2009 at 06:23:09
great help. cheers

Report •

Related Solutions

Ask Question