a

Naming files by date for sorting

by | Aug 16, 2018 | Newsletter, Tech Tips

file naming sortingAre you trying to organize and sort documents with dates in the title? For example, say you want to always have a list of newsletter files or meeting notes sort in chronological order. You may have started out naming files like this.

Newsletter-June-2018.pdf
Newsletter-July-2018.pdf
Newsletter-August-2018.pdf

But when you try to sort the file names, they are out of order like this, which is alphabetical and never chronological:

Newsletter-August-2018.pdf
Newsletter-July-2018.pdf
Newsletter-June-2018.pdf

What’s a better way to do this so that they actually sort in chronological order? Always use YY-MM-DD or YYYY-MM-DD format when naming files for this purpose. This means your documents will sort by year, then month, then day. And you can leave off DD (the day) if you don’t need to be that granular. Here’s our earlier example:

Newsletter-2018-06.pdf
Newsletter-2018-07.pdf
Newsletter-2018-08.pdf

And remember that if you want to sort documents by date that have different names, you can put the date firstrather than second. Here’s another example, which shows how this will sort different types of files chronologically:

2018-06-Interview-Notes.docx
2018-06-Newsletter.pdf
2018-06-Newsletter-Banner.jpg
2018-07-Interview-Notes.docx
2018-07-Newsletter.pdf
2018-07-Newsletter-Banner.jpg
2018-08-Lead-Article.docx
2018-08-Newsletter.pdf
2018-08-Newsletter-Banner.jpg

In this particular example, this means that any files used to create the newsletter are grouped together by date as well.

Naming files consistently and help your folders and archives stay organized for years to come!

Still have questions about best practices?  Our friendly Help Desk staff is always available for advice.  Contact us.

Used with permission from: Heartland Technologies