A Simple CSV Reader and Writer Classes for Java.
try {
File Source = new File("example.csv");
CSVReader Reader = new CSVReader(Source);
while ((Data = Reader.readRow()) != null) {
/* *** */
}
Reader.close();
} catch (IOException e) {
System.out.println(e);
}
try {
File Output = new File("example.csv");
CSVWriter Writer = new CSVWriter(Output);
String[] Data = new String[3];
Data[0] = new String("Hello");
Data[1] = new String("World");
Data[2] = new String("Hello World");
Writer.writeRow(Data);
Writer.close();
} catch (IOException e) {
System.out.println(e);
}
Contact me directly via email for support at [email protected]. Feel free to share how you are using this code in your own projects.