Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String [] col;
- String fmt = "%-10s %5s";
- try
- {
- File inFile = new File ("c:\\temp\\as1datafile.csv");
- Scanner myData = new Scanner(inFile);
- FileWriter fw = new FileWriter("c:\\temp\\AS1Result.txt",true);
- PrintWriter pw = new PrintWriter(fw);
- while (myData.hasNextLine())
- {
- col = myData.nextLine().split(",");
- System.out.println(String.format(fmt,
- col[0],col[3]));
- pw.println(String.format(fmt,
- col[0],col[3]));
- }
- myData.close();
- pw.close();
- }
- catch (Exception ex)
- {
- System.out.print(ex.getMessage());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement