import com.opencsv.CSVReader;
public class CSVReaderExample {
public static void main(String[] args) {
try {
CSVReader reader = new CSVReader(new FileReader("data.csv"));
String[] nextLine;
while ((nextLine = reader.readNext()) != null) {
for (String cell : nextLine) {
System.out.print(cell + " ");
}
System.out.println();
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}