Need urgent help with Batch Script !!!!

Microsoft Windows xp professional w/serv...
June 16, 2010 at 19:25:47
Specs: Windows Server 2003
Hello Everyone,

I am trying to read string from .xml file tag into variable
as ex.

<Header FileDate="01/01/2000"/>
<Body Type="Firm">
<Dept Firmid="0123" Name="abc"/>
<Trailer RecordCount="1">

To get FileDate=01/01/2000
I am using

for /F "tokens=2 delims= " %%i IN ('findstr /L "FileDate" D:\temp\myfile.xml) do call set var1=%%i

set set loaddate= %var1:~10,10%

echo %loaddate%

javacommand %loaddate%

I want to have loaddate=01/01/2000

but by using above command var1 is not able to retrieve required value.beacuse there is no delemiter which i can specify as its takes space by defualt delimeter or is there any other way by which i can add space in Tag.

Please suggest me what should I do to fix this problem

Thank you all for any suggesion.

Please help me out to encounter this problem.


See More: Need urgent help with Batch Script !!!!

Report •

June 16, 2010 at 20:00:04
Trust me on this:

Using urgent and 3 exclamation points is more apt to slow people down than to jump right in and help you.

You came here looking for free help, so please don't try to rush us into helping you.

If your issue truly is urgent, take out your wallet and hire a programmer.

Report •

June 16, 2010 at 20:41:48
Hi Derby,

Sorry for this posted title...

actually I 'm at really critical situation...

hope u can understand...I will keep in mind for future...

thnk you.

Report •

June 18, 2010 at 19:24:43
You've prob'ly already found the solution, (you were close, but lots of syntax noise):

for /F "tokens=2 delims="" %%i IN ('find /i "header FileDate=" ^< D:\temp\myfile.xml') do call javacommand %%i

Report •

Related Solutions

Ask Question