I have a text file that is being processed as part of a batch script for storage in a Document Management System. It’s similar to an XML, but slightly different (some proprietary format).
Anyways, My text file looks like this:
[BREAKDOC]
[Y:PDF]
[S:WORM]
[C0:20110331]
[C1:AC7100P]
[C2:ACH FILE EDIT LISTING]
[ENDBREAK]
C:\COLD\PROC\AC7100P.PDF
[BREAKDOC]
[Y:PDF]
[S:WORM]
[C0:20110331]
[C1:AT4550P]
[C2:ATM AP MAINTENANCE REPORT BY TIME]
[ENDBREAK]
C:\COLD\PROC\AT4550P.PDF
[BREAKDOC]
[Y:PDF]
[S:WORM]
[C0:20110331]
[C1:CD1640P]
[C2:CD TRIAL BALANCE]
[ENDBREAK]
C:\COLD\PROC\CD1640P.PDF
What I need is a vbscript or similar that can look into the file and wherever it sees the C0 value – which will always be a YYYYMMDD formatted date value, it will add a D value with the same date, only MMDDYYYY formatted.
Like this:
[BREAKDOC]
[Y:PDF]
[S:WORM]
[D:03312011]
[C0:20110331]
[C1:AC7100P]
[C2:ACH FILE EDIT LISTING]
[ENDBREAK]
C:\COLD\PROC\AC7100P.PDF
[BREAKDOC]
[Y:PDF]
[S:WORM]
[D:03312011]
[C0:20110331]
[C1:AT4550P]
[C2:ATM AP MAINTENANCE REPORT BY TIME]
[ENDBREAK]
C:\COLD\PROC\AT4550P.PDF
[BREAKDOC]
[Y:PDF]
[S:WORM]
[D:03312011]
[C0:20110331]
[C1:CD1640P]
[C2:CD TRIAL BALANCE]
[ENDBREAK]
C:\COLD\PROC\CD1640P.PDF
Is this something that could be done with a simple vbscript?
try this batch file
for more information, read
HELP SET