SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => SimCity 4 General Discussion => General Custom Content Discussion => Topic started by: Lowkee33 on January 23, 2011, 08:58:18 AM

Title: Batch Renaming
Post by: Lowkee33 on January 23, 2011, 08:58:18 AM
Hi all,

I was wondering if anyone knows of a program that will rename a whole bunch of files at once.

Basically what I have done is made a bunch of images with names like 0_0, 1_10, 6_23.  Adding a prefix I can do, like 0x123456, but I am still stuck with the number order.  I would like to be able to change the 0_0 to 50, the 1_10 to 82, and the 6_23 to f7 (and the other 165 files between them). 

I know there are programs like this, too many in fact.  Even a non-batch would work if it could have a list that it could remember.  Every time I do this the 0_0 is changed to 50...   

Thanks
Title: Re: Batch Renaming
Post by: cogeo on January 23, 2011, 10:20:35 AM
Quote from: Lowkee33 on January 23, 2011, 08:58:18 AM
...change the 0_0 to 50, the 1_10 to 82, and the 6_23 to f7 (and the other 165 files between them).
I can hardly see some "logic" here, so the conversion would be hard to specify in some "automated" manner, I'm afraid.

Quote from: Lowkee33 on January 23, 2011, 08:58:18 AM
I know there are programs like this, too many in fact.
I know none! Any link pls?

The only solution I can think of is make a "batch" file (.bat or .cmd) that will carry-out the desired operations, which I would suggest to be copying (under a different name) rather than renaming, so that the effects can be easily undone (deleting the copied files only).

Writing such a file can prove a little tedious, but this is unavoidable, if the renaming "rules" have no "logic". But if they do, eg it is somehow possible to get 50 from 0_0 by using formulas, you can make the conversions in Excel, and paste them into the batch file, by using a text editor capable of inserting/deleting/replacing text in column mode.
Title: Re: Batch Renaming
Post by: Lowkee33 on January 23, 2011, 10:39:27 AM
QuoteI know none! Any link pls?

My google search brought me here, looks like a good selection: List (http://graphicssoft.about.com/od/renamers/Batch_Rename_Picture_Files_Tools_Tips.htm)

I only downloaded 1-4a rename (http://www.1-4a.com/rename/rename-features.htm), and it could get close, but note quite.  Or should I say, I was spending enough time trying to figure it out that I just renamed them all myself.  It looks pretty good for renaming things in general, but not my specific need.

It also has some interesting functions like name files by the Star Trek Star Date.

QuoteI can hardly see some "logic" here, so the conversion would be hard to specify in some "automated" manner, I'm afraid.

Well, the logic is this.  I am working on a terrain mod, and my new method is to create one large texture (in this case 3584x12288) and then break it into 168 512x512s.  The initial results are pretty good, so I will continue.  The program that I use, Texture Maker, can do such "splitting".  The only problem is I can only define the prefix.  It orders them by columns, so I get something like 0x000000_0_0, 0x000000_0_1.....0x000000_7_23.  The suffix is changed to place into BatchPngtoFsh.

I am avoiding using the Maxis terrain texture instances, so I start at 0x50, and end at 0xf7.

But, the program doesn't need any logic.  I am always turning the _0_0 to 50.  If something could look at a folder and be told to find a specific file name and change it to a specific value, that is all I need.  If I could make a .doc with such rules to apply then that would work.

Title: Re: Batch Renaming
Post by: Battlecat on January 23, 2011, 11:02:33 AM
This program is my personal preference for bulk renaming.  I use it at work as well as for SC4:

http://www.bulkrenameutility.co.uk/Main_Intro.php
Title: Re: Batch Renaming
Post by: ScottFTL on January 23, 2011, 03:47:58 PM
There are many options available.  I've used a program called File Renamer Basic (http://www.sherrodcomputers.com/products_filerenamer.cfm) before.  It works well - and there is a free version available that isn't too crippled.  I think the main limitation is that the free version will not process subfolders.
Title: Re: Batch Renaming
Post by: Lowkee33 on January 23, 2011, 04:35:50 PM
Thanks BattleCat,  that did it.  I removed the whole name, re-added 0x000000 as the prefix and then counted in hex starting from 50 (80) as the suffix.  "Warning: you are about to modify 168 files". Yes, please, thanks.

The layout was a little scary at first, but everything I needed was right in front of me.