Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes i need to read files with dateformat filename from a folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "i need to read files with dateformat filename from a folder" Watch "i need to read files with dateformat filename from a folder" New topic
Author

i need to read files with dateformat filename from a folder

saritha yamagani
Greenhorn

Joined: Nov 25, 2010
Posts: 4
Hi I need to read files with string+date format filenames ie "example_23-Aug-2010.csv" from a single folder. please anyone can help.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

saritha yamagani wrote:Hi I need to read files with string+date format filenames ie "example_23-Aug-2010.csv" from a single folder. please anyone can help.


It looks like that you want to read CSV files (from the extension of the file). You can get CSV file parsers which you can make use of.

If its not CSV file- Then you can read each line and use split() to get the- String and date
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
And welcome to JavaRanch
saritha yamagani
Greenhorn

Joined: Nov 25, 2010
Posts: 4
mohamed sanaullah wrote:
saritha yamagani wrote:Hi I need to read files with string+date format filenames ie "example_23-Aug-2010.csv" from a single folder. please anyone can help.


It looks like that you want to read CSV files (from the extension of the file). You can get CSV file parsers which you can make use of.

If its not CSV file- Then you can read each line and use split() to get the- String and date




ya i want to read csv files .
saritha yamagani
Greenhorn

Joined: Nov 25, 2010
Posts: 4
Campbell Ritchie wrote:And welcome to JavaRanch





thank u.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

Check out java.io.File and its listing methods. They can take a filter that allows you to determine if the name is right or not.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Please be careful of spellings: not "u" or "ya", please.
saritha yamagani
Greenhorn

Joined: Nov 25, 2010
Posts: 4
Campbell Ritchie wrote:Please be careful of spellings: not "u" or "ya", please.


sorry sir. i will be careful of spellings from now onwards.
 
wood burning stoves
 
subject: i need to read files with dateformat filename from a folder