6 Replies Latest reply: Sep 30, 2006 7:12 PM by 807569 RSS

    help with reading a file from user after they tell me what file they want

      i am having trouble making my program read the file after the user enters the file they need here is what i have i'm not sure if its actually reading it yet
                  String path = "C:\temp";
                  //Create a scanner for input
                  Scanner input = new Scanner(System.in);
                  // Enter the file
                  System.out.println("Enter the file: ");
                                // Create a File instance
                  java.io.File file = new java.io.File(path + "output.txt");
            catch (Exception e){
                  System.out.println("Error reading file: " + e.toString()); 
      the file they are supposed to retrieve is salesdata.txt
      and it should show up as output.txt in my temp folder but its not :(