Two Plus Two Newer Archives

Two Plus Two Newer Archives (http://archives1.twoplustwo.com/index.php)
-   Computer Technical Help (http://archives1.twoplustwo.com/forumdisplay.php?f=50)
-   -   copying files from subfolders into parent + renaming them (http://archives1.twoplustwo.com/showthread.php?t=486107)

tob10 08-25-2007 02:05 PM

copying files from subfolders into parent + renaming them
 
hi,

i have about 1200 folders each with jpg files named from 1.jpg to 15.jpg. The folders themself are named from 1 to 1200 as well. I have to move all the jpg files into one single directory. As they have all the same filenames, i'd need to rename them like <foldername>_<pic_name>.jpg .
They also could be just named from 1 to 500000 or whatever, i just need to keep them in order.

can you think of any solutions ?
thx for your help !

PS: No, theyre NOT porn pics !!!

PS2: I could use a Linux system to accomplish this as well.

Gigi 08-25-2007 03:16 PM

Re: copying files from subfolders into parent + renaming them
 
Get www.autohotkey.com, which allows you to write scripts. Then use this script below.

<font class="small">Code:</font><hr /><pre>


This script assuses all the 1200 folders are located in "C:\Pictures" if not move them to this folder or change the script.
Also, make a folder called " C:\AllMyPictures" or change script.



FolderNameVar=1
PicNameVar=1

Loop, 1200
{

Loop, 15
{
FileMove, C:\Pictures\%FolderNameVar%\%PicNameVar%.jpg, C:\AllMyPictures\%FolderNameVar%_%PicNameVar%.jpg
PicNameVar++
}

PicNameVar=1
FolderNameVar++

}

Return


</pre><hr />

Oh btw this is if you have exactly 1200 folders and 15 pics in each one, I didn't make it parse the directories to count. Does the pic count vary in each folder?

Gigi 08-25-2007 03:28 PM

Re: copying files from subfolders into parent + renaming them
 
If there's any cute girls in the pictures feel free to post them.

tob10 08-25-2007 07:44 PM

Re: copying files from subfolders into parent + renaming them
 
wow, i have autohotkey, didnt think of that.

yes, sometimes the count may vary sometimes slightly but ill get that to work i think.

will post when i find smth appropriate (rather boring stuff)

thanks for your help !!!


All times are GMT -4. The time now is 09:56 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.