I need a solution. The problem in the values of the csv file is smoothed out using double quotes, so my code cannot read the full value of the product, its only reading is "Marlin-12", but the full name of the product is "Marlin-12", "- Custom".
PRODUCT_ID,CATEGORY,PRODUCT, MIN_STOCK_LEVEL
23, cat1, "Marlin - 12"" - Custom",2
24, cat1, "Marlin - 12"" – Custom1",3
25, cat2, "Marlin - 12"" – Custom2",3
26, cat3, "Marlin - 12"" – Custom3",2
27, cat4, "Marlin - 12"" - Custom",2
28, cat5, "Marlin - 12"" - Custom",2
Using im code to read csv file -
import com.Ostermiller.util.CSVParser
...
else if ( fileName.contains(".csv")) {
FileInputStream fis = new FileInputStream(fileName);
CSVParser csvp = new CSVParser(fis);
String[][] values = csvp.getAllValues();
tempClientProductCol = new ClientProductCol();
}
source
share