wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 3068
    
  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: 38033
    
  22
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: 19654
    
  18

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: 38033
    
  22
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i need to read files with dateformat filename from a folder
 
Similar Threads
How to ensure a file is written completely.
Reading excel files in folder by giving folder name as input
POI
here's the task i'm trying to accomplish.. how to read directories and files withJSP
how to read and list files in Jsp List