/* Written by Jen Chen Updated on March the 4th, 2003 Copyrighted by Jen Chen */ import java.io.*; import java.util.*; public class F05Lesson_1_File_IO { public static void main(String[] args) throws IOException{ String file = null, line; file = "Customers.csv"; BufferedReader buf = null; int lineNum = 0; String[] st = new String[12]; buf = new BufferedReader(new FileReader(file)); BufferedWriter w = new BufferedWriter(new FileWriter("tmp.htm")); line = buf.readLine(); w.write(" \n"); w.write(" \n"); while(line != null){ st = line.split(","); w.write(""); line = buf.readLine(); }//end of WHILE() w.write("
" + st[0] + "" + st[1] + "" + st[2] + "" + st[3] + "
"); w.close(); //Process p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE" + // " D:\\data\\Jen\\CS203\\Temp\\tmp.htm"); Process p = Runtime.getRuntime().exec("C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.EXE"); }//end of main() }//end of class File_IO1{}