Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Script that can scan all the folders and sub folders inside a folder and sort files according to the created dates.

Hi,

Script that can scan all the folders and sub folders inside a folder and sort files according to the created dates.
Foldername has to be in this format

DD-MM-YYY

Actually there are photo files Jpg in these folders and sub folders so need to create folders according to the date and put all the files inside the folder.
Ex:
I have folder structure like this
Folder1 > Folder1
                Folder2
                 Folder3> Folder1
So when its sorting folders have to be created within the folders should not get outside files into the folder.

Regards
Sharath
Avatar of ozo
ozo
Flag of United States of America image

I'm not quite sure what you mean
Do you want something like
find . -type d -exec ls -lt *.jpg \;
Avatar of bsharath

ASKER

I want a way to sort the jpg files according to the created date.But want then not to be moved out of the folders.
The script need to find them sort them by creating folders inside the folders.
so are you saying that when we find a file named
folder1/folder2/folder3/photo.jpg, which was created on 2007-October-13,
you want to rename it to
folder1/folder2/folder3/13-12-007/photo.jpg?
13-12-07 has to be the foldername.You are right....
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial