[SEMI-SOLVED] Reading CSV file of unknown structure into purely nominal/text

tennenrishintennenrishin MemberPosts:177Maven
edited October 2019 inHelp
What is the easiest way to read a CSV file that has an unknown set (and number) of attributes (named in the first row), into an exampleset where each value is read simply as a nominal (or text) attribute?

My attempt,





<宏/ >

















parses numeric-appearing data as numeric attributes.

Failing that, what is the easiest way to do it if the number of attributes is known (but not the names)?

My attempt:





<宏/ >
























only reads the last attribute and discards the rest.

Answers

  • tennenrishintennenrishin MemberPosts:177Maven
    Forgot to say please ;D
  • 妈rco_Boeck妈rco_Boeck Administrator, Moderator, Employee, Member, University ProfessorPosts:1,984RM Engineering
    Hi,

    if you just use the CSV operator as in your first example, you can simply follow it up with a "Numerical to Polynominal" operator, set to include all attributes. Or if you like, you can even follow that one up with a "Nominal to Text" operator. After that, all your attributes are of the type 'Text'.






    <宏/ >













    <连接from_op = "数值多项式”from_port="example set output" to_op="Nominal to Text" to_port="example set input"/>







    Regards,
    妈rco
  • tennenrishintennenrishin MemberPosts:177Maven
    Thanks Marco,

    but then "00005" ends up as "5", for example. I need plain text original attributes, and I don't know their names at design time. This seems like a very basic requirement, or am I missing something obvious?

    Regards,
    Isak
  • 妈rco_Boeck妈rco_Boeck Administrator, Moderator, Employee, Member, University ProfessorPosts:1,984RM Engineering
    Hi,

    unfortunately I think there is no out of the box way atm. I've modified your second process to at least do what you want:






    <宏/ >
























    Regards,
    妈rco
  • tennenrishintennenrishin MemberPosts:177Maven
    Thanks!
Sign InorRegisterto comment.