Verify Files Are Present

Dell / Precision m90
December 14, 2009 at 16:07:34
Specs: Microsoft Windows XP Professional, 1.83 GHz / 2046 MB
I am trying to automate the decryption of files AFTER the successful copy of the files from a DVD. File sizes can range from 2 MB to > 50 MB & can number from 2 files to 50 files based on the contents of an XML 'manifest.'

Is there an efficient way in a DOS Batch Command file to check & verify that ALL files listed in XML manifest have in fact been copied to a directory location?


See More: Verify Files Are Present

Report •


#1
December 14, 2009 at 19:24:33
what do the lines in the xml manifest look like? (sorry if this seems dumb, i'm not familiar with xml).

Report •

#2
December 15, 2009 at 03:58:00
No worries:

<?xml version="1.0" encoding="UTF-8" ?>
- <package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="extractfile_transmittal.xsd">
<ship_date>11/5/2009</ship_date>
<county>10</county>
<package_identifier>CCFRS20091104</package_identifier>
<abstract>The following are the CCextract files</abstract>
<special_instructions>None</special_instructions>
- <volume>
<volume_number>CCFRS20091104-1</volume_number>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000001.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000002.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000003.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000004.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000005.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000006.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000007.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000008.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000009.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000010.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000011.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000012.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000013.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000014.PCL.pgp</dataset_pcl>
<dataset_pcl>10.CCDD80J.PCLOUT.2009-11-04.000015.PCL.pgp</dataset_pcl>
</volume>
</package>


Report •

#3
December 15, 2009 at 05:06:51

@echo off && setlocal
for /f "tokens=1* delims=<" %%a in (manifest.xml) do (
for /f "tokens=1* delims=>" %%c in ("%%a") do (
if /i "%%c" equ "dataset_pcl" (
if not exist "%%d" echo %%d not found
:: this is just for info/debugging...
echo d is [%%d])
)
)

Report •

Related Solutions

#4
December 15, 2009 at 05:14:20
@echo off & setLocal enableDELAYedexpansion

for /f "tokens=* delims= " %%a in ('find ".pgp" ^< my.xml') do (
set S=%%a
set S=!S:^<dataset_pcl^>=!
set S=!S:^</dataset_pcl^>=!
if exist !S! (
echo OK
) else (
echo !S! is missing
)
)


=====================================
Helping others achieve escape felicity

M2


Report •

#5
December 16, 2009 at 08:14:08
Thanks M2 for the script - it works great! One of my challenges is that there is the potential to have to load up to 200 large PCL files to the network drive from DVD. This will take some time to load all files. How would I 'wrap' the PCL file 'check' into a 'timed' event (if you know what I mean)?

Report •

#6
December 16, 2009 at 08:24:16
I'm almost with you.

You mean to make it work over multiple files?


=====================================
Helping others achieve escape felicity

M2


Report •


Ask Question