cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Purge - Rename Versions to .1

DamianCastillo
1-Newbie

Purge - Rename Versions to .1

I want to purge and then rename file versions to .1 on a network drive. I need to do this on thousands of files inside hundreds of folders.

Any ideas?




"Too many people walk around like Clark Kent, because they don't realize they can Fly like Superman"
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2

Damian,

I would do this from a command window.
To purge all your folder do try this.
Make a list of the subfolders, I assume they are all one level below a top
level folder. If this is true the code would be as follows.
open a command window
change directory to the top level folder and enter the line below

dir /a:d /b > myFolders.txt

This will create a text file in the top level folder that lists all of the
subfolder.

enter the following line in the command window.

Run purge command in each folder Make sure PATH variable includes the path
to the ProE purge command found in the bin dir
Assuming the folders have no spaces in their names enter the line below to
do the renaming
for /f "tokens=1" %a in (myFolders.txt) do cd /d <full path=" to=" top=" level=" <br="/>folder>\%a && purge

If the folder do have spaces in their names enter the line below to do the
renaming
for /f "tokens=1*" %a in (myFolders.txt) do cd /d <full path=" to=" top=" level=" <br="/>folder>\%a %b && purge

Finally do the renaming, if folders do not have spaces in their names
for /f "tokens=1" %a in (myFolders.txt) do cd /d <full path=" to=" top=" level=" <br="/>folder>\%a && for /f "tokens=1-3" %b in ('dir /b *.prt.* *.asm.* *.drw.*')
do rename %b.%c.%d %b.%c.1

Finally do the renaming, if folder have spaces in their names
for /f "tokens=1*" %a in (myFolders.txt) do cd /d <full path=" to=" top=" level=" <br="/>folder>\%a %b && for /f "tokens=1-3" %c in ('dir /b *.prt.* *.asm.*
*.drw.*') do rename %c.%d.%e %c.%d.1

Hope this help,

If you have any questions please feel free to get back to me an we can
discuss.

David








I've used Purge/pro found here:
Top Tags