Options

"writing csv files, booleans should be 0 and 1"

wesselwessel Member Posts: 537 Maven
edited June 2019 in Help
Dear All,

How to write a .csv file with Boolean values as 1's and 0's.
Currently it writes out "true" and "false".

Best regards,

Wessel
Tagged:

Answers

  • Options
    Nils_WoehlerNils_Woehler Member Posts: 463 Maven
    Hi,

    you can use a Generate Attributes to create an attribute which contains 1 in case of true and 0 in case of false. Then remove your old attribute
    and rename the created one to your desired name.

    Best,
    Nils
  • Options
    wesselwessel Member Posts: 537 Maven
    Hey Nils,

    Thanks.

    So basically what your saying is.
    Create numeric attributes.
    (Numeric attributes write 0.0 and 1.0 by the way).

    Or should I use "1" and "0" in string value?
    To create a nominal attribute?
    I guess that would really write out what I was asking for.

    Best regards,

    Wessel
  • Options
    Nils_WoehlerNils_Woehler Member Posts: 463 Maven
    I would recommend you to create a nominal attribute as numerical attributes probably get written as 1.0 etc. :-)
    With a nominal attribute with values "1" and "0" it should write if you have unchecked the "quote nominal values" option.

    Best,
    Nils
Sign In or Register to comment.