We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
With xpresso you can work with CSV files Java with the simplicity of Python.
Read from file:
try (HappyFile f = x.open("filename.txt","r","utf-8")) { for (list<String> row : x.csv(f)) { //do stuff } }
Or, simply:
list<list<String>> data = x.list(x.csv("filename.txt","r","utf-8"));
Write to file:
try (HappyFile f = x.open("filename.txt","w","utf-8")) { for (list<?> row : data){ x.csv(f).writerow(row); } }
try (HappyFile f = x.open("filename.txt","w","utf-8")) { f.write(x.csv(data).toString()); }
Write to a StringBuilder:
StringBuilder builder = new StringBuilder(); for (list<?> row : data) { x.csv(builder).writerow(row); } String cs = c.toString();
String cs = x.csv(data).toString();