Filter example wich error Cannot instantiate 'attribute_value_filter'

alvesddalvesdd Member Posts: 6 Contributor I
edited January 2020 in Help
How can i solve this error in this process?

SetExemple
12345    S    B      F     
12346    S    B      F     
12347    S    B      F     
12348    S    C      G     
12350    N    C      G     
12352    N    C      G     
12353    N    C      G     
12354    N    B      F     
12360    N    B      F     

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.013">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.3.013" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="read_csv" compatibility="5.3.013" expanded="true" height="60" name="Read CSV" width="90" x="45" y="30">
        <parameter key="csv_file" value="C:\Users\diego_alves\Documents\TESTE.txt"/>
        <parameter key="first_row_as_names" value="false"/>
        <list key="annotations"/>
        <parameter key="encoding" value="windows-1252"/>
        <list key="data_set_meta_data_information">
          <parameter key="0" value="line.true.polynominal.attribute"/>
        </list>
      </operator>
      <operator activated="true" class="generate_attributes" compatibility="5.3.013" expanded="true" height="76" name="Generate Attributes" width="90" x="179" y="30">
        <list key="function_descriptions">
          <parameter key="Linha1" value="concat(line,&quot;3&quot;)"/>
        </list>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="5.3.013" expanded="true" height="76" name="Select Attributes" width="90" x="313" y="30">
        <parameter key="attribute_filter_type" value="single"/>
        <parameter key="attribute" value="Linha1"/>
      </operator>
      <operator activated="true" class="text:generate_extract" compatibility="5.3.002" expanded="true" height="60" name="Generate Extract" width="90" x="447" y="30">
        <parameter key="source_attribute" value="Linha1"/>
        <parameter key="query_type" value="Indexed"/>
        <list key="string_machting_queries"/>
        <list key="regular_expression_queries"/>
        <list key="regular_region_queries"/>
        <list key="xpath_queries"/>
        <list key="namespaces"/>
        <list key="index_queries">
          <parameter key="CD_ACAO " value="0.9"/>
          <parameter key="CD_BANCO " value="9.5"/>
          <parameter key="DS_BANCO " value="14.7"/>
          <parameter key="DS_REDE " value="21.8"/>
        </list>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="5.3.013" expanded="true" height="76" name="Select Attributes (2)" width="90" x="581" y="30">
        <parameter key="attribute_filter_type" value="single"/>
        <parameter key="attribute" value="Linha1"/>
        <parameter key="invert_selection" value="true"/>
      </operator>
      <operator activated="true" class="store" compatibility="5.3.013" expanded="true" height="60" name="Store" width="90" x="45" y="120">
        <parameter key="repository_entry" value="//Local Repository/teste filter"/>
      </operator>
      <operator activated="true" class="filter_examples" compatibility="5.3.013" expanded="true" height="76" name="Filter Examples" width="90" x="179" y="120">
        <parameter key="condition_class" value="attribute_value_filter"/>
        <parameter key="parameter_string" value="CD_BANCO =N"/>
      </operator>
      <connect from_op="Read CSV" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
      <connect from_op="Generate Attributes" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
      <connect from_op="Select Attributes" from_port="example set output" to_op="Generate Extract" to_port="Example Set"/>
      <connect from_op="Generate Extract" from_port="Example Set" to_op="Select Attributes (2)" to_port="example set input"/>
      <connect from_op="Select Attributes (2)" from_port="example set output" to_op="Store" to_port="input"/>
      <connect from_op="Store" from_port="through" to_op="Filter Examples" to_port="example set input"/>
      <connect from_op="Filter Examples" 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>
Tagged:

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,984 RM Engineering
    Hi,

    The problem looks to me like the data is not read in correctly with your "Read CSV" operator.
    I suggest first clicking on the "Import Configuration Wizard" button of the "Read CSV" operator. You can then make sure your settings are correct for your csv file and the data is loaded as desired. You could then place a breakpoint after the "Read CSV" operator by right-clicking on it and selecting 'Breakpoint After'. Then you will see what exactly you got and can adapt the following operators to work with your data.

    Regards,
    Marco
  • alvesddalvesdd Member Posts: 6 Contributor I
    Hi,

    I tried it, but don´t solve the problem,  this file is a .txt file, and the spaces isn't tab spaces!
    My a file .txt is positioned.
    Have other solutions?

    Regards,
    Diego
  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,984 RM Engineering
    Hi,

    you can also split on a regular expression, for example "[\s]+". This should net you 5 attributes (the last one is empty) and you can then deselect the last one in a later step.

    Regards,
    Marco
  • alvesddalvesdd Member Posts: 6 Contributor I
    Marco, thank you!

    But, i solved the problem with operator Rename.

    Regards,
    Diego
Sign In or Register to comment.