Java Utililty Methods ArrayList to CSV

List of utility methods to do ArrayList to CSV

Description

The list of methods to do ArrayList to CSV are organized into topic(s).

Method

StringtoCsv(ArrayList columnVectors)
to Csv
StringBuilder sb = new StringBuilder();
int n = columnVectors.size();
int m = columnVectors.get(0).length;
for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
        sb.append(columnVectors.get(j)[i]);
        if (j < n - 1) {
            sb.append(",");
...
StringToCSV(ArrayList vals)
To CSV
String res = "";
for (Integer i = 0; i < vals.size(); ++i) {
    if (i > 0) {
        res += ",";
    res += vals.get(i).toString();
return res;
...
StringtoCsvRow(ArrayList csvRow)
to Csv Row
StringBuilder csvStringBuilder = new StringBuilder();
makeCsvRow(csvRow, csvStringBuilder);
return csvStringBuilder.toString();