Create batch program files.

April 14, 2011 at 07:59:04
Specs: Windows XP
Looking for help creating a batch file to rename files in a folder.

Example - Original Folder Layout

Root Folders:

55A170AA
55A188AA
55A196AA
55A196BA
...

Root Folders contain 'Parts' Folder

55A170AA\Parts\xyzrtd_9.dxf
55A170AA\Parts\xyzrtd_10.dxf
55A170AA\Parts\xyzrtd_11.dxf
55A170AA\Parts\xyzrtd_12.dxf
55A170AA\Parts\xyzrtd_30.dxf
55A170AA\Parts\qqqnet_68.dxf
55A170AA\Parts\xyzrtd_69.dxf

55A188AA\Parts\removeo_37.dxf
55A188AA\Parts\removeei_38.dxf
55A188AA\Parts\bpinner_45.dxf

Desired Results


55A170AA\55a170AA-xyzrtd_9.dxf
5A170AA\55a170AA-xyzrtd_10.dxf
5A170AA\55a170AA-xyzrtd_11.dxf
5A170AA\55a170AA-xyzrtd_12.dxf
5A170AA\55a170AA-xyzrtd_30.dxf
5A170AA\55a170AA-qqqnet_68.dxf

55A188AA\55A188AA-removeo_37.dxf
55A188AA\55A188AA-removeei_38.dxf
55A188AA\55A188AA-bpinner_45.dxf

Please place the new files into a different directory.

If desired, I'll paypal you a few bucks for your time.

Thanks,
PK


See More: Create batch program files.

Report •


#1
April 14, 2011 at 14:53:30
how did we get from 55 to 5 and what happened to 69?

Report •

#2
April 15, 2011 at 06:36:05
Wizard,

My mistake. I've edited the example below. I am working with large directories of Autocad files. The root folder (55A170AA) contains all of the parts for a product line. The Autocad parts diagrams are stored in the 'parts' folder. I'd like to view the parts files without stepping through the directory tree. The parts directory contains other file types, but I am only interested in files with the 'dxf' extension.

I suppose it is easier to place the renamed files into a different directory.

For Example:

Directory\sub-directory\file
55A170AA\Parts\xyzrtd_9.dxf
55A170AA\Parts\xyzrtd_10.dxf
55A188AA\Parts\removeo_37.dxf
55A188AA\Parts\removeei_38.dxf

The new concatenated files are created in a new directory:

Directory\file
%new directory%\55A170AA-xyzrtd_9.dxf
%new directory%\55A170AA-xyzrtd_10.dxf
%new directory%\55A188AA-removeo_37.dxf
%new directory%\55A188AA-removeei_38.dxf


As a result, when parts files are viewed, I know the product line to which it is assigned.

*This would also allow me to sort the entire directory of parts by product line.*

55A170AA
55A188AA
55A196AA
55A196BA
...

Root Folders contain 'Parts' Folder

55A170AA\Parts\xyzrtd_9.dxf
55A170AA\Parts\xyzrtd_10.dxf
55A170AA\Parts\xyzrtd_11.dxf
55A170AA\Parts\xyzrtd_12.dxf
55A170AA\Parts\xyzrtd_30.dxf
55A170AA\Parts\qqqnet_68.dxf
55A170AA\Parts\xyzrtd_69.dxf

55A188AA\Parts\removeo_37.dxf
55A188AA\Parts\removeei_38.dxf
55A188AA\Parts\bpinner_45.dxf

Desired Results


55A170AA\55a170AA-xyzrtd_9.dxf
55A170AA\55a170AA-xyzrtd_10.dxf
55A170AA\55a170AA-xyzrtd_11.dxf
55A170AA\55a170AA-xyzrtd_12.dxf
55A170AA\55a170AA-xyzrtd_30.dxf
55A170AA\55a170AA-qqqnet_68.dxf

55A188AA\55A188AA-removeo_37.dxf
55A188AA\55A188AA-removeei_38.dxf
55A188AA\55A188AA-bpinner_45.dxf

Please place the new files into a different directory.

If desired, I'll paypal you a few bucks for your time.

Thanks,
PK


Report •

Related Solutions


Ask Question