Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-168

CsvFormat.nullString should not be escaped

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2
    • 1.3
    • Parser
    • None

    Description

      Hello,

      Use case: I'm generating MySQL dump files (text format) - for more details check this - http://dev.mysql.com/doc/refman/5.7/en/select-into.html.

      Issue: The value null is represented as "\N". Also by default the escape char is '\N'. The CsvPrinter.printAndEscape method will convert this value into

      "\\N"

      I suggest to modify the CsvPrinter in order to not escape the nullString value - it should be written as it is. I can create a pull request if you want.

      I consider it a minor issue because it can be mitigated by making sure that the escape character is not a part of the nullString - however in my case it means that the LOAD commands should be modified accordingly.

      Attachments

        1. codec-168-gg.diff
          6 kB
          Gary D. Gregory

        Issue Links

          Activity

            People

              ggregory Gary D. Gregory
              cornelcreanga cornel creanga
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: