Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming Multiple Files 1

Status
Not open for further replies.

diamondcat

Automotive
Joined
Aug 21, 2002
Messages
238
Location
US
I have an assembly that is made up of about 175 parts. The assembly and all of the parts are named 235-xxxx. Is there a way to do a batch name change to get rid of the 235- in front of all the files names? I just don't want to have to rename each individual file in SWX Explorer.

Thanks,
Lori
 
Not that I'm aware of. This can probably be done with API though.

You should check out the Model library at SW and see if one is already made there, or check out other sites and links faq559-520.

Scott Baugh, CSWP [spin] [americanflag]
3DVision Technologies
faq731-376
When in doubt, always check the help
 
Yes there is.

You need to do a "File-->Save As". From the "Save As" menu, click on the "References" button. Here, you can rename selected component files along with the assembly. You can use the "Replace" function to replace "235-" with an empty string in the names.

You can also save all of your files to a new directory by selecting a directory using "Browse" at the top of the window.

[bat]Gravity is a harsh mistress.[bat]
 
Thanks! I will try the Save As method.

Lori
 
Yes that will work, but you still have to change each of them manually. I thought you were looking for a "batch way" of changing them all, without changing them one at a time.

Like an API program for changing all files with a prefix of 235.

You can do practically the exact same thing in SW Explorer.

Open the assembly, click rename document, rename document, and click on each document there after and rename, and apply each one.

Really the only difference is having to push the apply button each time vs. this away.

Regards,

Scott Baugh, CSWP [spin] [americanflag]
3DVision Technologies
faq731-376
When in doubt, always check the help
 
Hmmm, I was actually looking for something so I didn't have to do each manually. I thought maybe the 'Save As' idea did that.

Lori
 
It's not quite a batch method, but using "Replace" can save a lot of time for something like this. Using the "Replace All" button can work well with naming conventions using prefixes and suffixes like this.

[bat]Gravity is a harsh mistress.[bat]
 
OK the replace all works pretty good. In the "Find What" type 235 and in the "Replace With" put nothing in there and click replace all. 235 is replaced with nothing (It removes it).

The only problem I can forsee with this is, if you have a file folder that has 235 in it it replaces it to, not just the filename.

[cheers],

Scott Baugh, CSWP [spin] [americanflag]
3DVision Technologies
faq731-376
When in doubt, always check the help
 
Yes, one needs to be exceedingly careful using "Replace All". Choose your strings wisely. I recommend using "235-" instead of just "235". That way "235-0023511.sldprt" does not become "-0011.sldprt". If you're dealing with suffixes instead of prefixes, I find it helpful to include th ".sld" for clarity.

[bat]Gravity is a harsh mistress.[bat]
 
Thanks for all of the help, this should save me a bunch of time.

Lori
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top