Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can multiple files be read from a path  RSS feed

 
Pradeep Bhat
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am stuck up with the following problem.

I have a folder with a number of xml files.(New xml files can be added any time).

I need to read the files one by one and use then for my operations.

Can this be done ?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, sure. Use File.listFiles() to list the contents of a single directory. For each file, open an InputStream or Reader the same way you would for any other file. Have you read the Java Tutorial on Basc I/O?
 
Pradeep Bhat
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just begun reading Java Tutorial on Basic I/O.
Thanks for the help Jim.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!