Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

Process files in a directory

Thread view: 
Sharp Tool - 29 Jun 2005 14:33 GMT
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
Ingo R. Homann - 29 Jun 2005 15:20 GMT
Hi Sharp Tool,

> Hi
>
[quoted text clipped - 11 lines]
> help is appreciated
> Sharp

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

Ciao,
Ingo
Thomas Weidenfeller - 29 Jun 2005 15:22 GMT
> I have a large number (~1000) of files to analyse.
> These files are in a directory.
[quoted text clipped - 3 lines]
> 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

Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

iksrazal@terra.com.br - 29 Jun 2005 20:41 GMT
Beyond the other comments, If you can use Java 5.0 take a look at
Coconut AIO package (Asychronous I/O) - its JSR is:

http://www.jcp.org/en/jsr/detail?id=203

Its available as a seperate package, almost made it into Java 5.0 and
has a good chance for 1.6/6.0 .

HTH,
iksrazal
http://www.braziloutsource.com/
Roedy Green - 30 Jun 2005 07:23 GMT
>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

Signature

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.