Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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
  • 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
Posts: 3159
33
Google App Engine Java Ruby
  • 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
Posts: 48427
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch
 
saritha yamagani
Greenhorn
Posts: 4
  • 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
  • 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: 20495
54
Chrome Eclipse IDE Java Windows
  • 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
Posts: 48427
56
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic