Skip to content
Permalink
Browse files

0003994: DbExport CSV file should escape quote characters with double

quotes. Documentation
  • Loading branch information...
jaredfrees committed Jun 12, 2019
1 parent 9e85e2d commit 63b397e715a47acd4970a62ffc868f002a22590c
@@ -12,7 +12,7 @@ The next tab allows for specific choices for the format and content of the expor

image::appendix/dbexport/dbexport-format-screen.png[width=600]

The format option allows for choices between *SQL*, *XML*, *CSV*, and *SYM_XML*.
The format option allows for choices between *SQL*, *XML*, *CSV*, *CSV_DQUOTE*, and *SYM_XML*.
The Compatibility tab allows for a choice between any of the supported SQL dialects.
The list of check boxes allows for more specific options for the content of the file including insert, drop or create scripts. A where clause can also be added to make the SQL more specific.

@@ -34,7 +34,7 @@ They are as follows:
- *--dir <arg>* : Indicate a directory to use for the export of files. If the directory is specified, then a file per table will be written to the directory.
- *-e, --engine <arg>* : The name of a configured engine. The name should correspond to an engine.name setting in one of the properties files in the engines directory.
- *--exclude-columns <arg>* : A comma separated list of columns to exclude from the exported tables.
- *--format <arg>* : Output format: SQL, CSV, XML, or SYM_XML.
- *--format <arg>* : Output format: SQL, CSV, CSV_DQUOTE, XML, or SYM_XML.
- *-h, --help* : Print help with each option and description.
- *-i, --comments* : Write informational comments.
- *--no-create-info* : Do not write statements to create tables.
@@ -10,7 +10,7 @@ It also asks for the number of rows to commit, as well as multiple more specific

image::appendix/dbimport/dbimport-tab.png[width=600]

Input files can be in SQL, XML, CSV, or SYM_XML file formats.
Input files can be in SQL, XML, CSV, CSV_DQUOTE, or SYM_XML file formats.

The following is an example of the *SQL* format used for DbImport.

@@ -34,10 +34,20 @@ The following is an example of the *CSV* format used for DbImport.
----
"ITEM_ID","NAME"
"12","zSYwAyLGsbvsLhYFLBqmeprkfISVTlRnfHwsHFZcmZUpKQMXkT"
"174","WHQwyMhrWVZzmXyzzHiXRSyzfuOSImgqflupGrtLwmaGrOvFek"
"213","UlGKwTSLeygaxzkdTQxnvrSQMulBKbljpAkSVmbQCUONULUAlF"
"239","OOvqpLHIVcbOlJCXemNjCajcEJaBrPlneDkCZXqGYMXIuGRORq"
"471","RFHEaWcFtPDOkqEtbomEomuEWDQoAuyvJVnjPEsPpaqLxEuWpj"
"113","SDFSDf\"SD\"ggdD"
----

The following is an example of the *CSV_DQUOTE* format used for DbImport.
*CSV_DQUOTE* escapes quote characters with double quotes if there are quotes in the column values so it can be correctly parsed by programs like Excel.
For example, "SPbSDf""SD""gNdD" parses to SPbSDf"SD"gNdD.

[source, csv]
----
"ITEM_ID","NAME"
"12","zSYwAyLGsbvsLhYFLBqmeprkfISVTlRnfHwsHFZcmZUpKQMXkT"
"471","RFHEaWcFtPDOkqEtbomEomuEWDQoAuyvJVnjPEsPpaqLxEuWpj"
"113","SPbSDf""SD""gNdD"
----

The following is an example of the *XML* format used for DbImport.
@@ -95,7 +105,7 @@ They are as follows:
- *-e, --engine <arg>* : The name of a configured engine. The name should correspond to an engine.name setting in one of the properties files in the engines directory.
- *--filter-classes <arg>* : A comma separated list of Java classes that implement org.jumpmind.symmetric.io.data.writer.IDatabaseWriterFilter. These filters will be applied to the import.
- *--force* : Ignore ANY errors and attempt to continue on processing the import data.
- *--format <arg>* : Input format: SQL, CSV, XML, or SYM_XML.
- *--format <arg>* : Input format: SQL, CSV, CSV_DQUOTE, XML, or SYM_XML.
- *-h, --help* : Print help with each option and description.
- *--ignore* : Indicates that conflicts with existing rows should be ignored.
- *--interval <arg>* : The number of milliseconds to wait between committing transaction.
@@ -130,10 +140,20 @@ The following is an example of the *CSV* format used for DbImport.
----
"ITEM_ID","NAME"
"12","zSYwAyLGsbvsLhYFLBqmeprkfISVTlRnfHwsHFZcmZUpKQMXkT"
"174","WHQwyMhrWVZzmXyzzHiXRSyzfuOSImgqflupGrtLwmaGrOvFek"
"213","UlGKwTSLeygaxzkdTQxnvrSQMulBKbljpAkSVmbQCUONULUAlF"
"239","OOvqpLHIVcbOlJCXemNjCajcEJaBrPlneDkCZXqGYMXIuGRORq"
"471","RFHEaWcFtPDOkqEtbomEomuEWDQoAuyvJVnjPEsPpaqLxEuWpj"
"113","SDFSDf\"SD\"ggdD"
----

The following is an example of the *CSV_DQUOTE* format used for DbImport.
*CSV_DQUOTE* escapes quote characters with double quotes if there are quotes in the column values so it can be correctly parsed by programs like Excel.
For example, "SPbSDf""SD""gNdD" parses to SPbSDf"SD"gNdD.

[source, csv]
----
"ITEM_ID","NAME"
"12","zSYwAyLGsbvsLhYFLBqmeprkfISVTlRnfHwsHFZcmZUpKQMXkT"
"471","RFHEaWcFtPDOkqEtbomEomuEWDQoAuyvJVnjPEsPpaqLxEuWpj"
"113","SPbSDf""SD""gNdD"
----

The following is an example of the *XML* format used for DbImport.

0 comments on commit 63b397e

Please sign in to comment.
You can’t perform that action at this time.