mutiple validation in same do not working

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Rajnishjc_27
Posts: 21
Joined: 16 Aug 2019 23:35

mutiple validation in same do not working

#1 Post by Rajnishjc_27 » 23 Aug 2019 07:14

Hi Frinds

i have script like below
for /F " skip=1 tokens=3,7 delims=;" %%a in (%file% ) do (
set token7=%%b
set token3=%%a
echo !token7! !token3!  it is displaing both the value

if !TOKEN7! equ 0 echo(field "DIS_TYPE" = " " is Blank)
if !token3! equ 0 echo(field "Reason" = " " is Blank)  but it not showing this message
)

only one message its showing, where is the wrong..?

elzooilogico
Posts: 128
Joined: 23 May 2016 15:39
Location: Spain

Re: mutiple validation in same do not working

#2 Post by elzooilogico » 23 Aug 2019 13:58

review your code, you have unbalanced parentheses. try to change

Code: Select all

echo(…
to

Code: Select all

echo/…
to see what's happening. then tou may return to

Code: Select all

echo(…
as it has especial meaning, it's not an opening parens ar all!

pieh-ejdsch
Posts: 239
Joined: 04 Mar 2014 11:14
Location: germany

Re: mutiple validation in same do not working

#3 Post by pieh-ejdsch » 24 Aug 2019 08:15

Hello,
closing parenthesis is a special character.
Try to Escape every special character with a caret.

Code: Select all

echo( (this^) ^& that ^<are^> "escaped" ^| signs
Phil

Post Reply