Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3014

CSV - add support for unix-style line endings and different delimiters

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Rejected
    • Priority: Low
    • Resolution: Won't Do
    • Affects Version/s: 3.14.0
    • Fix Version/s: None
    • Labels:
      None
    • Story Points:
      0

      Description

      Our CSV parser – libutils/csv_parser.c – only supports Windows-style line endings, and has no support for different delimiters (only commas are allowed).

      It's possible we should do some code cleanup as well.

      Parser Extensions

      User defined delimiter

      Delimiters may be only a single character. Unlike some other functions (e.g. parsestringarray() ) take a regular expression to match the pattern on which to split columns. The configurable delimiter for parsing CSV is intentionally limited to a single character because of considerations for parsing speed and minimizing complexity. This is common in other implementations as well, python for example only accepts one-character strings as delimiters.

      Unix line endings

      The parser will accept Unix (LF, aka \n) line endings when explicitly enabled.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              karlhto Karl Hole Totland
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: