DOS - Re-arrange file parts and build text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tuxalot
    New Member
    • Feb 2009
    • 200

    DOS - Re-arrange file parts and build text file

    I have a text file showing files in directories. The text file looks like this:

    "C:\folderA\fil e1.zip"
    "C:\folderA\fol derB\folderC\fi le2.zip"
    "C:\folderA\fol derE\folderX\fo lderU\file3.zip "

    The text file is created by using a batch file with this code segment:
    Code:
    for /r %inpath% %%g in (*.zip) do echo "%%g" >> textfile.txt
    Now, I wish to use the same directory tree and build a second text file with a list of the zip file names contained within, but I want to strip out the folder tree and just list the zip file names. And the zips are on different levels as the above example shows. As part of the solution, I would like to reformat how the zip file is presented. I need to break the zip file into parts and them re-assemble them in the text file. For example, the files use this naming convention:

    parta-parta - partb - partc.zip

    So my delimiters for the zip file would be "space hyphen space".

    I would like the resulting text file to read (The quotes and parenthesis are intentional and should appear in the text file):

    "partb - partc (first two digits of parta).zip"

    Thanks for looking and I appreciate any help.
Working...