Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4118504
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:58:08+00:00 2026-05-20T22:58:08+00:00

I have a text file that is being processed as part of a batch

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:58:09+00:00Added an answer on May 20, 2026 at 10:58 pm

    try this batch file

    @echo off
    setlocal enabledelayedexpansion
    for /F %%a in (%1) do (
     set c=%%a
     set c0=!c:~1,2!
     if .!c0!==.C0 (
       set yyyy=!c:~4,4!
       set mm=!c:~8,2!
       set dd=!c:~10,2!
       echo [D:!mm!!dd!!yyyy!]
     )
     echo !c!
    )
    

    for more information, read HELP SET

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file that is being written to as part of a
I have a script that takes an uploaded text file, parses it and then
I have Text file that contains data separated with a comma , . How
I have a text file that I want to edit by rewriting it to
I have a text file that's appended to over time and periodically I want
I have a text file that looks like this. A 102 B 456 C
I have a text file that contains cached data in JSON format. I'm trying
I have a text file that contains some strings separated by ,. Strings are
I have a text file that I want to edit using Java. It has
I have a text file that contains a list of filenames, minus the extension,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.