Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Process files in a directory

Reply
Thread Tools

Process files in a directory

 
 
Sharp Tool
Guest
Posts: n/a
 
      06-29-2005
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



 
Reply With Quote
 
 
 
 
Ingo R. Homann
Guest
Posts: n/a
 
      06-29-2005
Hi Sharp Tool,

Sharp Tool wrote:
> 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

 
Reply With Quote
 
 
 
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      06-29-2005
Sharp Tool wrote:
> 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/...ile.html#list()
http://java.sun.com/j2se/1.5.0/docs/...FilenameFilter)

/Thomas

--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/
 
Reply With Quote
 
iksrazal@terra.com.br
Guest
Posts: n/a
 
      06-29-2005
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/

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-30-2005
On Wed, 29 Jun 2005 13:33:16 GMT, "Sharp Tool"
<(E-Mail Removed)> wrote or quoted :

>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/...s_rumsfeld.htm

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
Recurse Directories and process files in directory KraftDiner Python 5 08-13-2006 12:47 AM
Directory and files names in temporary asp.net directory =?Utf-8?B?QmFzIEhlbmRyaWtz?= ASP .Net 5 01-31-2005 01:56 PM
list all css files in a directory and sub directory TJS ASP .Net 1 06-23-2004 10:49 AM



Advertisments