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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
poern81
Posts: 1
Joined: 07 May 2019 03:41

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

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.

Regards,
Poern

aGerman
Expert
Posts: 3825
Joined: 22 Jan 2010 18:01
Location: Germany