Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Writing a CSV; Enclosures are also applied to to the header row - right or wrong?

  1. #1

    Default Writing a CSV; Enclosures are also applied to to the header row - right or wrong?

    We had a fun discussion over here today about the way the "Table Output Step" does handle enclosures, for example ".
    If you generate a CSV with PDI (in my case 4.3.0) containing a header row, the enclosure is also applied to the header row. That means, you will get something like this;
    "STRING";NUMBER;INTEGER
    "Hallo";5.2;1
    "Welt";10,3;5
    The enclosure is allways applied - even if it is not nescessary. We tried some other tools to generate a csv, and each one does handle this topic on his one way (quote everything exept the header, quote only when needed..).

    As far as i know - there is no "official" spec on CSV's. So whats the common way of handling quotes? Why does PDI handle this as it does right now (i'm shure there are any thoughts or RFC's behind)?
    Background of this discussion is a customer "bug" report that our output should not contain quoted headers - only quoted records. In my opinion, the quoted headers are ok - but i'm not the customer

    (I fixed this with some bash magic and everyone is happy again.)

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Again, there is no right or wrong, only JIRA cases with feature requests asking for improvements ;-)

    I can imagine a "Quoting" drop-down box for the user with options like:
    • Don't quote any fields
    • Always quote all String fields
    • Only quote String fields when needed
    • Always quote all fields


    Perhaps I forgot a few possibilities :-)

  3. #3

    Default

    Great idea, i did it right now. See PDI-8418

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.