Tell me how to implement. At the moment there is a method for adding a new entry in CSV:
private static void addContact() { String outputFile = "myPhoneBook.csv"; boolean alreadyExists = new File(outputFile).exists(); try { CsvWriter csvOutput = new CsvWriter(new FileWriter(outputFile, true), ','); if (!alreadyExists) { csvOutput.write("ID"); csvOutput.write("Name"); csvOutput.write("Phone"); csvOutput.write("City"); csvOutput.endRecord(); } csvOutput.write(new String(String.valueOf(getLastColumnValue()))); csvOutput.write("Bruce"); csvOutput.write("12345"); csvOutput.write("Plovdiv"); csvOutput.endRecord(); csvOutput.close(); } catch (IOException e) { e.printStackTrace(); } } According to the task there is no possibility to insert duplicate values for the name and phone number. Tell me how you can implement.