private void removeFromFile(String name, String path) {
        String temp = "";
        String line;
        boolean found = false;

        try {

            Scanner reader = new Scanner(new File(path));
            // Store all data except specified line in temp
            while (reader.hasNextLine()) {
                line = reader.nextLine();
                // If the name line does not contain the name, it is appended with a newline character
                if (!line.contains(name)) {
                    temp += line + "\n";
                } else {
                    //If it is found at all
                    found = true;
                }
            }
            reader.close();

            //Empty out file beforehand
            try {
                PrintWriter writer = new PrintWriter(new File(path));
                writer.print("");
                writer.close();
            } catch(FileNotFoundException e) {
                System.out.println("File not found!");
            }

            writeToFile(temp, path);

            if(!found) {
                System.out.println("Such an item does not exist!");
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }