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!
Search year -10 in folder name
-
Stamimail
- Posts: 1122
- Joined: Sat Aug 31, 2013 9:05 pm
Re: Search year -10 in folder name
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
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
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,
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
- Developer
- Posts: 19904
- Joined: Fri Oct 16, 2009 11:31 pm
Re: Search year -10 in folder name
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
2. Write the years explicitly:
parent:C:\Data folder: 2000|2001|2002|2003|2004|2005|2006|2007|2008|2009|2010
-
Stamimail
- Posts: 1122
- Joined: Sat Aug 31, 2013 9:05 pm
Re: Search year -10 in folder name
Regex can be a 3rd trick. isn't it?
-
void
- Developer
- Posts: 19904
- Joined: Fri Oct 16, 2009 11:31 pm
Re: Search year -10 in folder name
with regex you could try the following:
parent:C:\Data folder: regex:"20(0[0-9]|10)"
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
Wow, any thanks!
The regex works perfectly!!
Cedric
The regex works perfectly!!
Cedric