Search year -10 in folder name

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
cedsyn
Posts: 3
Joined: Tue Mar 23, 2021 3:45 pm

Search year -10 in folder name

Post by cedsyn » Tue Mar 23, 2021 3:51 pm

Hello,

I need to find all the folders, excluding subfolders, that are older than 10 years. Based on the folder name, not on the folder age.
The aim is to find all the folders older than 10 years (based on the name) to cut them for archiving reason.

Exemple my C:\Data\ contains those folders:
C:\Data\TEST-2008
C:\Data\TEST-2009
C:\Data\TEST-2010
C:\Data\TEST-2011
C:\Data\TEST-2012
C:\Data\TEST-2013
C:\Data\TEST-2014
C:\Data\TEST-2015
C:\Data\TEST-2016
C:\Data\DATA-2010
C:\Data\DATA-2011
C:\Data\DATA-2012
C:\Data\DATA-2013

Should return only, as we are in 2021:
C:\Data\TEST-2008
C:\Data\TEST-2009
C:\Data\TEST-2010
C:\Data\DATA-2010

Many thanks!

Stamimail
Posts: 801
Joined: Sat Aug 31, 2013 9:05 pm

Re: Search year -10 in folder name

Post by Stamimail » Tue Mar 23, 2021 6:24 pm

infolder:C:\Data\ folders:

2 tricks:

1. Use a renamer tool - and make it:
C:\Data\2008-TEST
C:\Data\2009-TEST
and then sort it by name.

2. Write the years explicitly:
infolder:C:\Data\ folders: 2008|2009|2010

cedsyn
Posts: 3
Joined: Tue Mar 23, 2021 3:45 pm

Re: Search year -10 in folder name

Post by cedsyn » Fri Mar 26, 2021 9:11 am

Hello,

I cannot rename the folders.
They are accountancy folders used by a software.
After 10 years we can archive/delete them (legal reason) and we first need to move them from the storage.

Any idea?

Thanks,

void
Site Admin
Posts: 6454
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search year -10 in folder name

Post by void » Fri Mar 26, 2021 11:19 am

Please try Stamimail's second suggestion:

2. Write the years explicitly:
parent:C:\Data folder: 2000|2001|2002|2003|2004|2005|2006|2007|2008|2009|2010

Stamimail
Posts: 801
Joined: Sat Aug 31, 2013 9:05 pm

Re: Search year -10 in folder name

Post by Stamimail » Fri Mar 26, 2021 12:31 pm

Regex can be a 3rd trick. isn't it?

void
Site Admin
Posts: 6454
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search year -10 in folder name

Post by void » Sat Mar 27, 2021 11:54 am

with regex you could try the following:

parent:C:\Data folder: regex:"20(0[0-9]|10)"

cedsyn
Posts: 3
Joined: Tue Mar 23, 2021 3:45 pm

Re: Search year -10 in folder name

Post by cedsyn » Mon Mar 29, 2021 9:21 am

Wow, any thanks!

The regex works perfectly!!

Cedric

Post Reply