How to sort by date in filename?

21,967

Solution 1

If the files were created on set dates you can just sort them by date in explorer. I'm guessing this is not the case. So if you rename files as Molly suggested (yyyy-mm-dd) then sorting by name will also sort them by date.

Since you already have a bunch of such files instead of renaming them one by one, I suggest you use Total commander, which has built in multi-rename tool. This tool enables you to easily rename files to this format. Just rename each batch of files that have same type of name after another.

To rename for example files named dd-mm-yyyy to yyyy-mm-dd:

  • select files you want to rename (using either r-mouse click or space)
  • press ctrl+M or select menu Files -> Multi rename tool
  • press Range button and select year part, press ok
  • repeat for month and day and put - in between, you should end up with [N7-10]-[N4-5]-[N1-2]
  • press Start button (bottom of the form) to run the renaming process
  • repeat the process for other groups with similar names

Solution 2

rename your files YYYY-MM-DD.doc and you're fine.

Solution 3

Use something like Bulk Rename Utility to rename the files into the format yymmdd_anyothertext.doc, then sorting on name will arrange the files in date order.

BRU support regular expression, or if necessary you can just do the renaming in several passes if the regex isn't too obvious.

Share:
21,967

Related videos on Youtube

Sander
Author by

Sander

Updated on September 17, 2022

Comments

  • Sander
    Sander almost 2 years

    I have a bunch of meeting minutes, where the filename is the date the meeting took place. I would like to sort by this date.

    The dates in my case are of the following form: 01.01.2009.doc 30.12.1999.doc 6.05.2010.doc ..

    Some files are also of the following form: AD 01.01.2009.doc KT2 05.05.2000.doc ...

    How can I do this? Is it even possible?

  • tiaga
    tiaga almost 15 years
    I'd definitely do YYYYMMDD (i.e. 4 year digits) otherwise confusion may ensue. See Molly's answer to this.
  • Joey
    Joey almost 15 years
    I'd even use separators since it's much easier to read :-)
  • shababhsiddique
    shababhsiddique almost 5 years
    very helpful. I have a ton of scanned reciepts that are named by date. But not sortable. i can convert it easily.