import java.io.*; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner; public class upperCase { public static void main(String[]args) { Scanner in = null; PrintWriter out = null; try { File file = new File("Chapter9.txt"); in = new Scanner(file); out = new PrintWriter("output.txt"); } catch (FileNotFoundException ex) { System.out.println(ex.getMessage()); System.out.println("in" + System.getProperty("user.dir")); System.exit(1); } while(in.hasNextLine()) { String record = in.nextLine(); if (record.indexOf("bwbecker") >= 0) { String upper = record.toUpperCase(); System.out.println(upper); System.out.println("output.txt"); } } //Close the file in.close(); out.close(); } }Can anyone help me?? Thank You!
Discuss This Question: 5  Replies