Page 1 of 1

Get a value from a text file fails with error "<" can not be processed syntactically at this point"

Posted: 07 May 2019 04:21
by poern81
Hi all,
for a bigger batch script I need to get a value from a text file.

the text file "helpFile" always contains a string that looks like this:

<UserValue title="Version" value="">33</UserValue>

I want to put value into a variable but this alway fails with the message ""<" can not be processed syntactically at this point".

I have tried the following:

set /p helpVariable=<c:\tmp\helpFile
set helpVariable=%helpVariable:~36%,-13%
echo %helpVariable%

in this case helpVariable should be 33.

Maybe someone has an idea that helps me.

Thanks in advance for your help.

Regards,
Poern

Re: Get a value from a text file fails with error "<" can not be processed syntactically at this point"

Posted: 07 May 2019 06:18
by aGerman
I answered this question in a German forum already.
https://administrator.de/forum/dos-batc ... 48216.html

Steffen