Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Other Topics > Computer Technical Help
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2007, 02:05 PM
tob10 tob10 is offline
Member
 
Join Date: Mar 2007
Location: btn
Posts: 37
Default 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.
Reply With Quote
  #2  
Old 08-25-2007, 03:16 PM
Gigi Gigi is offline
Member
 
Join Date: Jun 2007
Posts: 63
Default 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?
Reply With Quote
  #3  
Old 08-25-2007, 03:28 PM
Gigi Gigi is offline
Member
 
Join Date: Jun 2007
Posts: 63
Default Re: copying files from subfolders into parent + renaming them

If there's any cute girls in the pictures feel free to post them.
Reply With Quote
  #4  
Old 08-25-2007, 07:44 PM
tob10 tob10 is offline
Member
 
Join Date: Mar 2007
Location: btn
Posts: 37
Default 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 !!!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:53 PM.


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