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

Post Reply
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"

#1 Post by poern81 » 07 May 2019 04:21

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

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

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

#2 Post by aGerman » 07 May 2019 06:18

I answered this question in a German forum already.
https://administrator.de/forum/dos-batc ... 48216.html

Steffen

Post Reply