Solved Check XML file (containing various dates) for current date a

May 30, 2014 at 03:53:44
Specs: Windows 7
I have an XML file with applicaiton name and its expiration date.Say below is the XML

<?xml version="1.0"?>
-<MailAlert> -<app1> <name> XXX</name> <LEDate> 6/30/2014 </LEDate> </app1> -<app2> <name> YYY </name> <LEDate> 5/25/2014 </LEDate> </app2> -<app3> <name> ZZZ</name> <LEDate> 5/30/2015 </LEDate> </app3> -<app4> <name> EEE</name> <LEDate> 7/30/2014 </LEDate> </app4> </MailAlert>

Now I want to write a batch script which runs on daily basis and checks XML file for dates .If any of the dates mentioned in XML file is equal to current date then perform certain steps .
Can you please guide me on how to parse through XML file using Batch script.Thanks in advance for your time .

See More: Check XML file (containing various dates) for current date a

Report •

May 30, 2014 at 19:27:17
✔ Best Answer
Depending on your date format (echo %date%), and the remaining shoes that need to drop:
@echo off
set xml=a.xml
set v=/%date:~3%
set v=%v: 0=%
set v=%v:/0=/%
echo searching for "%v%" in %xml%
find "%v%" %xml%&&echo perform further operations||echo nothing to do
::======== end batch
make sure the xml file is not in unicode format, for this version to work

message edited by nbrane

Report •
Related Solutions

Ask Question