[Dive4elements-commits] [PATCH 2 of 2] Insert CR and LF at the end of each line in CSV exports

Wald Commits scm-commit at wald.intevation.org
Wed Jan 30 14:42:45 CET 2013


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1359553337 -3600
# Node ID a707ef0481886780e96ad476678161fb582ef9f8
# Parent  67bbcee26e21dcb34e4a58bc1271fcfa57ec645f
Insert CR and LF at the end of each line in CSV exports.

diff -r 67bbcee26e21 -r a707ef048188 flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java	Wed Jan 30 14:39:28 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java	Wed Jan 30 14:42:17 2013 +0100
@@ -244,11 +244,14 @@
     {
         logger.info("AbstractExporter.generateCSV");
 
+        char quote = '"';
+        char escape = '\\';
+
         CSVWriter writer = new CSVWriter(
             new OutputStreamWriter(
                 out,
                 DEFAULT_CSV_CHARSET),
-            DEFAULT_CSV_SEPARATOR);
+            DEFAULT_CSV_SEPARATOR, quote, escape, "\r\n");
 
         writeCSVData(writer);
 


More information about the Dive4elements-commits mailing list