The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

parse a nominal attribute

sebastian_gonzasebastian_gonza RapidMiner Certified Analyst, Member Posts: 52 Guru
edited August 2019 in Help

Hi

 

I want to parse the following nominal attribute an example is "01020202_drt234@tg" I want to create 3 colums the first containing what is before the "_" another from the "_" to the "@" and the last one with what remains, I saw a parse from numbers but not from a data type like this, is there an operator for this o how could I do it?

 

Thanks for your help

Tagged:

Best Answer

  • yyhuangyyhuang Administrator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 364 RM Data Scientist
    Solution Accepted

    Hi @sebastian_gonza,

     

    You can use split operator.

     

    <?xml version="1.0" encoding="UTF-8"?><process version="9.0.002">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="9.0.002" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="generate_data_user_specification" compatibility="9.0.002" expanded="true" height="68" name="Generate Data by User Specification" width="90" x="313" y="34">
    <list key="attribute_values">
    <parameter key="input" value="&quot;01020202_drt234@tg&quot;"/>
    </list>
    <list key="set_additional_roles"/>
    </operator>
    <operator activated="true" class="split" compatibility="9.0.002" expanded="true" height="82" name="Split" width="90" x="447" y="34">
    <parameter key="split_pattern" value="_"/>
    </operator>
    <operator activated="true" class="split" compatibility="9.0.002" expanded="true" height="82" name="Split (2)" width="90" x="581" y="34">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="input_2"/>
    <parameter key="split_pattern" value="@/&gt;
    </operator>
    <connect from_op="Generate Data by User Specification" from_port="output" to_op="Split" to_port="example set input"/>
    <connect from_op="Split" from_port="example set output" to_op="Split (2)" to_port="example set input"/>
    <connect from_op="Split (2)" 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.

     

    YY

Sign In or Register to comment.