Process files in a directory

S

Sharp Tool

Hi

I have a large number (~1000) of files to analyse.
These files are in a directory.
I will use Java to run a program in batch mode to analyse each of these
files.
What is the best way of going through each of them.
I can think of providing the name for each of the files to the program to
analyse, but that doesn't sound very smart.
I would like to be able to go through each file automatically like if its in
a tree structure or something.
I hope what i said make sense.

help is appreciated
Sharp
 
I

Ingo R. Homann

Hi Sharp Tool,

Sharp said:
Hi

I have a large number (~1000) of files to analyse.
These files are in a directory.
I will use Java to run a program in batch mode to analyse each of these
files.
What is the best way of going through each of them.
I can think of providing the name for each of the files to the program to
analyse, but that doesn't sound very smart.
I would like to be able to go through each file automatically like if its in
a tree structure or something.
I hope what i said make sense.

help is appreciated
Sharp

Are you looking for java.io.File.list()?

Ciao,
Ingo
 
T

Thomas Weidenfeller

Sharp said:
I have a large number (~1000) of files to analyse.
These files are in a directory.
I will use Java to run a program in batch mode to analyse each of these
files.
What is the best way of going through each of them.
I can think of providing the name for each of the files to the program to
analyse, but that doesn't sound very smart.

http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#list()
http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#list(java.io.FilenameFilter)

/Thomas
 
R

Roedy Green

I would like to be able to go through each file automatically like if its in
a tree structure or something.
File.list( FileFilter )
See http://mindprod.com/jgloss/file.html
http://mindprod.com/jgloss/filter.html


--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top