This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

i need to read files with dateformat filename from a folder

 
saritha yamagani
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47253
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch
 
saritha yamagani
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:And welcome to JavaRanch





thank u.
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47253
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be careful of spellings: not "u" or "ya", please.
 
saritha yamagani
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Please be careful of spellings: not "u" or "ya", please.


sorry sir. i will be careful of spellings from now onwards.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic