I m trying hard to just have my program look into the specified directory and create a separate file object for each folder the directory contains, there is usually 2 but there could be more. I got that, but i need to keep the files separate so I can pass them to another class down the road to do some stuff. I cant seem to logically think of the way to after the while to write the first file out and then loop back through without overwriting f2 please help. mucho gracias
import java.io.*;
import java.util.*;
class initializer{
static String dir = new String("C:\\Data\\");
public static void main(String[] args){
File f = new File(dir);
String[] files = f.list();
try{
System.out.println("there are " + files.length + " files in the directory");
for (int i = 0;i < files.length;i++)
{
File f2 = new File(dir + files[i]);
Vector temp = new Vector();
BufferedReader br;
String line;
br = new BufferedReader(new FileReader(f2));
line = br.readLine();
while (line != null) {
temp.add(line);
line = br.readLine(); //here we have the needed info, but it needs to be stored!
File[] fIter = f2.listFiles;
//for(int j = 0; j < files.length; j++){
// fIter = new File();}
//File[] fEach = temp.copyInto();
// System.out.println(fEach[j]);}
}//end while
System.out.println(temp);
}
}catch(Exception e){
System.out.println("Exception occured: " + e);
e.printStackTrace();}
}//end main
}//end class
[This message has been edited by bob boyd (edited September 05, 2001).]
[This message has been edited by bob boyd (edited September 05, 2001).]