Need to compare CSV data with table rows data
Have tried map for csv and array for table query
Need to compare CSV data with table rows data
Have tried map for csv and array for table query
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.