Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- BufferedReader br = new BufferedReader(new FileReader(file));
- System.out.println("\nFile Opened Successfully.");
- Scanner scanner = new Scanner(file);
- Node root = null;
- // Loops through file until EOF
- while(scanner.hasNext())
- {
- // Scans the line
- String data = scanner.nextLine();
- // Makes a string to read the letter which is the function
- String letter = data.replaceAll("[0-9]", "");
- // Makes a string to read the numbers
- String numbers = data.replaceAll("[a-zA-Z] ", "");
- int numInput = Integer.parseInt(numbers);
- if(letter.equals("i"))
- {
- System.out.println("Insert function");
- }
- if(letter.equals("d"))
- {
- System.out.println("Delete function");
- }
- if(letter.equals("q"))
- {
- System.out.println("Quit function");
- }
- }
- // Closes text file
- br.close();
- scanner.close();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement