Hi All,
I am just trying to read from one
doc file and writing to another
word doc file. this application runs file. But problem is that when i went to that directory and tries to open that new written
word file it is not opening it showing error that some path problem taht is .
Document name or path is invalid.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class filewriter {
public static void main (
String[] args) throws IOException {
String readLine = "";
File tempfile = new File ("C:/test/test.doc");
File newFile = new File ("C:/test/resumes/result.doc");
try{
BufferedReader br = new BufferedReader(new FileReader(tempfile));
BufferedWriter out = new BufferedWriter( new FileWriter(newFile));
while ((readLine = br.readLine()) != null) {
out.write(readLine);
}
br.close();
out.close();
}catch(IOException e) {
System.out.println("exception");
e.printStackTrace();
}
System.out.println("no exception");
}
}