How to move files to folder depending on creation timestamp?

Hi,

How can I sort thousands of files into their "home" directory based on the file creation timestamp?

The selected files should be moved to the folder e.g. "C:\xxx\YYYYMM".

E.g. the example file "Vid_20080529T144604.mpg" (file name contains the values of the creation timestamp!) should be move to "C:\xxx\200805".

I tried this button

COPY TO "C:\xxx{createdate|yyyyMM}" MOVE COPYFILETIMES=yes

but maybe "createdate" (or also "modifieddate") do not work?

I tried the HELP in DO but didn't found any keyword list for the COPY nor able to use REGEX.

Any idea?

I'm sure it should simple work in DO - maybe it's to hot today here in Austria? :wink:

Latest beta 11.5.5 installed.

Thanks a lot.

{createdate|yyyyMM} is a code for the Rename command or GUI, and won't work outside of it.

If the files are already on the same drive as the destination folder, you can use the Rename command or GUI to move them, similar to what you're doing. You just need to add the filename on the end, which can be done using a wildcard.

In the GUI:

Old name: *
New Name: C:\xxx{createddate|yyyyMM}*
Type: Standard Rename
[x] Enable file information fields

For the command:

Rename PATTERN * TO "C:\xxx{createddate|yyyyMM}*" FILEINFO

But if you need it to work across drives, you may need to use a short script.

Hi leo,
What you suggested doesn't really work like intended. The command has to be like this: Rename PATTERN * TO "C:\xxx{createddate|D#yyyyMM}*" FILEINFO. Additionally this command doesn't save the original created date but will set it to the actual date.

You're right, the D# was missing and without that a different date format was being used for the folder (yyyy-MM-dd). Sorry about that.

It uses the file's created date here, though, and the moved file's date is not changed either if that is what you meant.

Ah yes, the moved file's date seems only be changed to the actual date if you move the files across drives.

Thanks a lot! That works!

Missing features

  • for the COPY/MOVE all additional keywords (incl. from meta tags).
  • Option "Preserve the timestamps of moved files" ...
    (this would avoid the 15 sec delay when you delete + move the file to the deleted destination .. see [url]Creation date not equal when moving file from dir a to b])

Timestamps are already preserved on renamed files, unless you run into NTFS tunnelling, which is such a rare case it is rarely worth the performance hit it would add to every single move operation to test for it.

btw:

Just noticed I got a lot of pics from a friend where the correct shooting time is in the file name. Modified & Created is different.

How can I set the Modified & Created to a value (via e.g. regex) from the filename? Looked around with SetAttr but ... (I know I can set Modified from Created and the other way.)

I know it is possible with a script but for only 40-50 files I don't want to write a script. :wink:

Maybe another feature request? :wink:

@fuzi1968
I know this is an old thread and most likely you already solved the issue. Maybe for future purposes then.
There is a script from MrC that could be helpful to change modified dates from filenames. I use it quite often.
In my case the filedates are always at the -end- of the filename, before the extension.
So Filename-yxz-[date].ext.

=

=
video