Joe,
Thanks for the info, got me off to a great start. I am having trouble through with the output file. I get the follwoing error when compiling.
:\JavaPrograms\FileDirectory.java:122: cannot resolve symbol
symbol : variable out
location: class FileDirectory
out.print(Copybook);
import java.io.*;
public class FileDirectory
{
public static void main(
String args[]) throws IOException
{
File dir = new File("C:\\tmp1");
String filedir = "C:\\tmp1\\";
String filep = null;
if ((dir.exists()) && (dir.isDirectory()))
{
File datao = new File("example.txt");
PrintWriter out = new PrintWriter(
new BufferedWriter(
new FileWriter(datao)));
System.out.println("Directory: " + dir.getCanonicalPath());
String[] files = dir.list();
for (int i = 0; i < files.length; i++)
{
filep = filedir + files[i];
System.out.println(filep);
processCopybook(filep);
}
out.close();
}
else
{
System.out.println("directory does not exists");
}
}
private static void processCopybook(String filen) throws IOException
{
---some code then
out.print(Copybook);
I want only one output file from all of the input files.