Author: kmorin Date: 2013-11-25 10:54:29 +0100 (Mon, 25 Nov 2013) New Revision: 2598 Url: http://nuiton.org/projects/nuiton-csv/repository/revisions/2598 Log: fixes #2932 There is a semicolon in the end of each row in the exported files (not in the header) Modified: trunk/src/main/java/org/nuiton/csv/Export.java Modified: trunk/src/main/java/org/nuiton/csv/Export.java =================================================================== --- trunk/src/main/java/org/nuiton/csv/Export.java 2013-10-10 20:12:34 UTC (rev 2597) +++ trunk/src/main/java/org/nuiton/csv/Export.java 2013-11-25 09:54:29 UTC (rev 2598) @@ -197,6 +197,8 @@ protected void writeRow(Writer writer, Iterable<ExportableColumn<E, Object>> columns, E row) throws Exception { + + List<String> formattedCells = new LinkedList<String>(); for (ExportableColumn<E, Object> column : columns) { Object cell = column.getValue(row); String formattedCell = column.formatValue(cell); @@ -206,9 +208,10 @@ " returned a null value." + column.toString()); } formattedCell = StringUtil.escapeCsvValue(formattedCell, separator); - writer.write(formattedCell); - writer.write(separator); + formattedCells.add(formattedCell); } + String formattedRow = StringUtil.join(formattedCells, separator, true); + writer.write(formattedRow); writer.write('\n'); }