• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fetching Files with filename

 
sk mehrotra
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can i fetch the files from a directory on its name on the user parameter, i.e on the Date as if the user specify date then files should be displayed between 01_05_2009 to 03_05_2009
Eg: filename_01_05_2009.txt, filename_02_05_2009.txt, filename_03_05_2009.txt, filename_04_05_2009.txt.
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a SimpleDateFormat to parse your file names into Date objects:
The quotes enable you to add "filename" and ".txt" as literal text.
 
sk mehrotra
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
I need to get the files on the date and name of the file, i.e
If filename is like ABCD_1111_2222_10-MAR-2008.txt in this case we'll be knowing the "ABCD" and ""10-MAR-2009" and secondly we need to search the files on the date range provide through the parameters, i.e
if user provide the date range between 10-mar-2009 and 15-mare-2009, then search of files would be between 10-mar-2009 to 15-mar-2009, i.e file would be between ABCD_1111_2222_10-MAR-2008.txt to ABCD_1111_2222_15-MAR-2008.txt.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic