"How duplicate lines (have one server for one applications)?"

sofia75
sofia75 New Altair Community Member
edited November 5 in Community Q&A
Hi 
I have a file where in many cases one server host several applications. In my file, I have only one line with the server's name and the applications names seraparate by ",". Exemple below:

VMPRDSUUGSQL40 Toto, Tata,Titi

I would need to have a line by application (one server=one application), like this:

VMPRDSUUGSQL40 Toto
VMPRDSUUGSQL40 Tata
VMPRDSUUGSQL40 Titi

How can I have this please?

Thank you very much,

Regards

Tagged:

Answers

  • lionelderkrikor
    lionelderkrikor New Altair Community Member
    Hi @sofia75,

    Use De-pivot operator :

    <?xml version="1.0" encoding="UTF-8"?><process version="9.2.000-BETA2">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="9.2.000-BETA2" expanded="true" name="Process">
        <parameter key="logverbosity" value="init"/>
        <parameter key="random_seed" value="2001"/>
        <parameter key="send_mail" value="never"/>
        <parameter key="notification_email" value=""/>
        <parameter key="process_duration_for_mail" value="30"/>
        <parameter key="encoding" value="SYSTEM"/>
        <process expanded="true">
          <operator activated="true" breakpoints="after" class="utility:create_exampleset" compatibility="9.2.000-BETA2" expanded="true" height="68" name="Create ExampleSet" width="90" x="112" y="85">
            <parameter key="generator_type" value="comma separated text"/>
            <parameter key="number_of_examples" value="100"/>
            <parameter key="use_stepsize" value="false"/>
            <list key="function_descriptions"/>
            <parameter key="add_id_attribute" value="false"/>
            <list key="numeric_series_configuration"/>
            <list key="date_series_configuration"/>
            <list key="date_series_configuration (interval)"/>
            <parameter key="date_format" value="yyyy-MM-dd HH:mm:ss"/>
            <parameter key="time_zone" value="SYSTEM"/>
            <parameter key="input_csv_text" value="Id,att1,att2,att3&#10;WMPRDSUUGSQL40,Toto,Yata,Tati"/>
            <parameter key="column_separator" value=","/>
            <parameter key="parse_all_as_nominal" value="false"/>
            <parameter key="decimal_point_character" value="."/>
            <parameter key="trim_attribute_names" value="true"/>
          </operator>
          <operator activated="true" class="de_pivot" compatibility="9.2.000-BETA2" expanded="true" height="82" name="De-Pivot" width="90" x="313" y="85">
            <list key="attribute_name">
              <parameter key="test" value="att."/>
            </list>
            <parameter key="index_attribute" value="id"/>
            <parameter key="create_nominal_index" value="false"/>
            <parameter key="keep_missings" value="false"/>
          </operator>
          <connect from_op="Create ExampleSet" from_port="output" to_op="De-Pivot" to_port="example set input"/>
          <connect from_op="De-Pivot" from_port="example set output" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>
        </process>
      </operator>
    </process>
    
    Hope it helps,

    Regards,

    Lionel
     

  • sofia75
    sofia75 New Altair Community Member
    Thank you very much Lionel. I am completly new in RapidMiner, my file is an Excel. I tried your code in "Excute Script" operator and then " De-pivot operator" and I get an error (line 7) and try several changes but I did not could fix error. Then I put De-pivot operator" first and Excute Script" operator (as bewlow) and I have this error "supply a value for index_attribute"...what attribute can I put?

    Can you please tell me what wrong ?

    Thank you,

    Regards,

  • lionelderkrikor
    lionelderkrikor New Altair Community Member
    Hi @sofia75,

    You can call the index attribute "id" and remove it later with Select Attributes operator.

    Regards,

    Lionel