Command to sort 20k photos into date modified albums?

rive22

Supreme [H]ardness
Joined
Mar 10, 2004
Messages
4,610
I have a folder of about 20,000 photos from a digicam that I'm organizing for a friend, since I'm rebuilding the system I couldn't bare the mess and had to tackle this too. I've gone through with software to remove the duplicates but now I want to put them into folders labeled by their date created, or date modified. Is there a command for this? Or even a prog.
 

Mackowitz

[H]ard|Gawd
Joined
Apr 28, 2008
Messages
1,766
I use ThumbsPlus to organize my photos. It has an auto rename feature, so you could sort by date and then rename by year/month or whatever, but it's notsuper automated - you would basically need to rename each months worth of files, which may or may not be a lot of work.

It's not super cheap if all you want to do is rename some files, but I think it has a free 30 day trial. :confused:
 

tesfaye

2[H]4U
Joined
Apr 17, 2003
Messages
3,420
Let me see if I can whip something up real quick that just does what rive22 asked. It'll be command line based and fairly simple to use (program.exe "source_path" "destination_path" "use date modified")

This is for Windows right? It'll be a .Net 2.0 app. Let me know before I spend anymore time on this.
 

rive22

Supreme [H]ardness
Joined
Mar 10, 2004
Messages
4,610
Tesfaye yes win7 and that sounds awesome :D

Mackowitz cool I'll have to do some experimenting in a bit with that prog too :cool:
 

tesfaye

2[H]4U
Joined
Apr 17, 2003
Messages
3,420
Ok. File's Done! (Would have been much sooner but I got called into a meeting.)

PM me with your email address and I'll send over a zip file with the executable. I'll be at my desk until 4:30 and then I'm heading home so if you get back to me after 4:20 I probably won't respond until after 6pm.
 

bexamous

[H]ard|Gawd
Joined
Dec 12, 2005
Messages
1,670
Hah I have this same problem, I plug in CF card to computer and move files to an _in folder and it just keeps growing and growing. So I sorted to folders year-month, eg 2010-01\file.cr2

find ./ -mindepth 1 -maxdepth 1 -type f -printf '"%h/%f" %TY.%Tm\n' | awk ' { system("mkdir -p "$NF) ; system("cp " $0 ) } '
 

keenan

2[H]4U
Joined
Aug 5, 2009
Messages
2,695
Metamorphose has a bit of a weird UI, but I think it can do this.
 

tesfaye

2[H]4U
Joined
Apr 17, 2003
Messages
3,420
Hah I have this same problem, I plug in CF card to computer and move files to an _in folder and it just keeps growing and growing. So I sorted to folders year-month, eg 2010-01\file.cr2

find ./ -mindepth 1 -maxdepth 1 -type f -printf '"%h/%f" %TY.%Tm\n' | awk ' { system("mkdir -p "$NF) ; system("cp " $0 ) } '
Looks like some sort of Linux script. Pardon my ignorance, I haven't touched Linux or Unix in YEARS.
 

/dev/null

[H]F Junkie
Joined
Mar 31, 2001
Messages
14,450
I think f-spot will IMPORT photos and put them into directories by date. It's a free download & I think there is a windows version as well.
 

devil22

2[H]4U
Joined
Jan 1, 2003
Messages
3,834
Hah I have this same problem, I plug in CF card to computer and move files to an _in folder and it just keeps growing and growing. So I sorted to folders year-month, eg 2010-01\file.cr2

find ./ -mindepth 1 -maxdepth 1 -type f -printf '"%h/%f" %TY.%Tm\n' | awk ' { system("mkdir -p "$NF) ; system("cp " $0 ) } '
And if you are using Windows, here's the powershell script that does likewise:

dir | ?{$_.psiscontainer -eq $false}| %{$a="$($_.creationtime.year)-$($_.creationtime.month)";mkdir -ea 0 $a;cp $_ $a}
 
Last edited:

keenan

2[H]4U
Joined
Aug 5, 2009
Messages
2,695
Looks more like Perl lol.

I thought Powershell was a lot more elegant than that.
 

rive22

Supreme [H]ardness
Joined
Mar 10, 2004
Messages
4,610
Tesfaye, I got your email this morning thanks a ton man! I can't wait to start this baby up and get working on these pics. My Vertex boot drive fried this afternoon while swapping it to another computer or I'm not sure what it's deal is yet, so I didn't get the chance to play with your prog yet as I just got home and am trying to get this other machine working again for tomorrow, that's why took me so long for my reply. This weekend and I'll let ya know how it goes! :D
 

tesfaye

2[H]4U
Joined
Apr 17, 2003
Messages
3,420
Holy shit, that sucks dude! I had a rather odd data loss issue with one of my Vertex drives as well. One day I turned on my computer and the drive wasn't recognized, so I switched the SATA port it was connected to and when the machine came back up all my data was gone. Luckily it was my games drive so I just reformatted and reinstalled the games. My OS drive hasn't given me any problems so far (knocks on wood).
 

eeyrjmr

[H]ardness Supreme
Joined
Apr 23, 2002
Messages
4,363
Hah I have this same problem, I plug in CF card to computer and move files to an _in folder and it just keeps growing and growing. So I sorted to folders year-month, eg 2010-01\file.cr2

find ./ -mindepth 1 -maxdepth 1 -type f -printf '"%h/%f" %TY.%Tm\n' | awk ' { system("mkdir -p "$NF) ; system("cp " $0 ) } '
I do a similar thing but extract EXIF data to get a better datetime as well as rename the files
 
Joined
Jan 24, 2004
Messages
46
I'm sorry to resurrect this old thread, but this is just what i'm looking for!

Could someone help me figure out how to organize my photos into folders according to the date taken?

ex:
2010/August/001.jpg

I have years of photos that need to be better organized... :eek:
 

x509

[H]ard|Gawd
Joined
Sep 20, 2009
Messages
1,990
Hah I have this same problem, I plug in CF card to computer and move files to an _in folder and it just keeps growing and growing. So I sorted to folders year-month, eg 2010-01\file.cr2

find ./ -mindepth 1 -maxdepth 1 -type f -printf '"%h/%f" %TY.%Tm\n' | awk ' { system("mkdir -p "$NF) ; system("cp " $0 ) } '
Bexamous,

I have the same problem. Years of photos that need to be sorted by date. I tried playing around with this script. I'll be the first to admit that my memory of DOS commands is kinda poor :(. When I did a find /? so that I could see the various parameters, I couldn't find the parameters mindepth, maxdepth, type. Nor could I find awk as a Win XP cmd. (I recognize awk from my old UNIX days.) What am I overlooking?

Also, how could I extend this script to sort out by days? And possibly by camera type, since I have a Nikon D SLR, a Canon P&S, plus several cellphone "cameras?"

Thanks
 
Top