I need to write some code to rename files, image files to use with the "build map" python script, I know there are some renaming type programs out there, in fact I was using Irfan View, but there's only so far you can go i.e. if I divided a large picture into 100 squares on a 10 x 10 grid, named the first lot of files 1x0.bmp, 2x0.bmp,... 10x0.bmp, then 2x0.bmp, 2x1.bmp,.. etc etc up to 10x10.bmp then i can use the build map script to put all those pieces back together to form one whole picture (or as I did before use it to make images of coloured blocks (see
viewtopic.php?f=9&t=15480&hilit=Build+Map&start=10#p214417))
Anyway renaming with Irfan View means I can name the first lot by putting in the Batch rename settings (Pattern setting) something like: 0x# (and it's specified in the settings to increment by 1 each time) so it will then remane the folders 0x1.bmp, 0x2.bmp etc but I can't get it to rename multiple strings (or even 2) in the same filename.
I turned to a free utility called BRU (
http://www.bulkrenameutility.co.uk/Main_Intro.php) which i find out can do it only (apparently) by using the JavaScript section of the UI, unfortunately you have to register as a commercial user and buy a license for 90 odd dollars.. so .. I know that from within the BRU program it's possible to highlight the files , and place the code in to get the desired result, the code being:
newName = (~~(counter / 10)+1) + "x" + counter % 10;
However, now I have Node.js and this snippet of code BUT, I have no idea how to write the rest of the code to link the File path so the program knows where they are and to implement the renaming code to this particular path (i.e. "C:\Program Files/Project/pics" ..or some such)
Sorry for the long-winded explanation and request but hopefully someone out there will be willing to torture themselves... ahem I mean, help me out with this (it might even spur me on to learn a bit more about programming..!!) Thanks
