🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Remove characters not desired in a field

User: "bea11005"
New Altair Community Member
Updated by Jocelyn

Hello.

I need to get from a Text Fiel in a table a number inside.

The field contains that: 

{"op":"&","c":[{"type":"date","d":">=","t":1480582800},{"type":"group"}],"showc":[true,true]}

 

I need only the number. I can't remove {} [] characters, I've been using Replace operator to remove the other characters.

How can I do to extract the number and remove {}[] characters? Is there other way to extract the number without Replace operator?

 

Find more posts tagged with

Sort by:
1 - 3 of 31
    User: "kayman"
    New Altair Community Member
    Accepted Answer

    Not sure what you mean, but using this regex as a replacement operation on your original string the result will be 

     

    1480582800

    Which is in the end what you needed, isn't it? 

     

    The example I added shows you this, the document contains your string, the replacement uses the regex and the outcome will be your number

    User: "kayman"
    New Altair Community Member
    Accepted Answer

    Then you use the regex in a replace operator.

     

    like this :

     

    <?xml version="1.0" encoding="UTF-8"?><process version="7.6.001">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="7.6.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="text:create_document" compatibility="7.5.000" expanded="true" height="68" name="Create Document" width="90" x="112" y="85">
    <parameter key="text" value="{&quot;op&quot;:&quot;&amp;&quot;,&quot;c&quot;:[{&quot;type&quot;:&quot;date&quot;,&quot;d&quot;:&quot;&gt;=&quot;,&quot;t&quot;:1480582800},{&quot;type&quot;:&quot;group&quot;}],&quot;showc&quot;:[true,true]}"/>
    </operator>
    <operator activated="true" class="text:documents_to_data" compatibility="7.5.000" expanded="true" height="82" name="Documents to Data" width="90" x="246" y="85">
    <parameter key="text_attribute" value="txt"/>
    </operator>
    <operator activated="true" class="replace" compatibility="7.6.001" expanded="true" height="82" name="Replace" width="90" x="380" y="85">
    <parameter key="attribute_filter_type" value="single"/>
    <parameter key="attribute" value="txt"/>
    <parameter key="replace_what" value="^.*?&quot;t&quot;:(\d+)\}.*$"/>
    <parameter key="replace_by" value="$1"/>
    </operator>
    <connect from_op="Create Document" from_port="output" to_op="Documents to Data" to_port="documents 1"/>
    <connect from_op="Documents to Data" from_port="example set" to_op="Replace" to_port="example set input"/>
    <connect from_op="Replace" 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>

    I only used a document because your string contains a lot of quotes, but the logic works the same when it is an example set

    User: "kayman"
    New Altair Community Member
    Accepted Answer

    Use the 'parse numbers' operator, this will make an integer from your nominals. Just ensure they are all numeric