-1

Need to compare CSV data with table rows data

Have tried map for csv and array for table query

Dolly
  • 97
  • 3
  • 18

1 Answers1

0

I hope it will help you:

public List<String[]> readCSV(String csvFile) throws IOException {
    List<String[]> returnVal = new ArrayList<>();
    String line;
    try (BufferedReader br = new BufferedReader(new FileReader(csvFile))) {
       while ((line = br.readLine()) != null)
           returnVal.add(line.split(","));
    }
    return returnVal;
}

This function take csv file(path) and return list of rows.

You can compare the rows or do any analysis on the data.

Idan Str
  • 614
  • 1
  • 11
  • 33