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

wessel
wessel New Altair Community Member
edited November 5 in Community Q&A
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

  • Nils_Woehler
    Nils_Woehler New Altair Community Member
    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
  • wessel
    wessel New Altair Community Member
    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
  • Nils_Woehler
    Nils_Woehler New Altair Community Member
    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