It is also possible to use findstr with its regular expression capability:
Assumed:
- date format: DD.MM.YYYY
- minimum date: 01.01.1900
If you want to list all date <= 23.11.2013:
- 01.01.1900 - 31.12.1999: "..[.]..[.]19"
- 01.01.2000 - 31.12.2009: "..[.]..[.]200"
- 01.01.2010 - 31.12.2012: "..[.]..[.]201[0-2]"
- 01.01.2013 - 30.09.2013: "..[.]0[1-9][.]2013"
- 01.10.2013 - 31.10.2013: "..[.]10[.]2013"
- 01.11.2013 - 19.11.2013: "[0-1][1-9][.]11[.]2013"
- 20.11.2013 - 23.11.2013: "2[0-3][.]11[.]2013"
Code: Select all
dir /s | findstr /R /C:"..[.]..[.]19" /C:"..[.]..[.]200" /C:"..[.]..[.]201[0-2]" /C:"..[.]0[1-9][.]2013" /C:"..[.]10[.]2013" /C:"[0-1][1-9][.]11[.]2013" /C:"2[0-3][.]11[.]2013"
If you want to list all date >= 24.11.2013 (additionally assumed maxium date is somewhen in 2014):
- 24.11.2013 - 29.11.2013: "2[4-9][.]11[.]2013"
- 30.11.2013 - 30.11.2013: "30[.]11[.]2013"
- 01.12.2013 - 31.12.2013: "..[.]12[.]2013"
- 01.01.2014 - 31.12.2014: "..[.]..[.]2014"
Code: Select all
dir /s | findstr /R /C:"2[4-9][.]11[.]2013" /C:"30[.]11[.]2013" /C:"..[.]12[.]2013" /C:"..[.]..[.]2014"
penpen
PS: You may shorten the needed params by different regular expressions, for example you may inverse the second search to simulate the first one (second solution with the findstr option "/V").