How to extract from string

I know I have done this in CVI before..
I just can't remember how I did it.. 
(braindead today???!!!???)
Here goes:
Take a string:
"Mary had a little lamb"
FindPattern "little"
resulting string:  ""Mary had a lamb"
What I have works up to finding the pattern and it's location.
-sigh-
I know I'll kick myself because from what I recall, it's a very simple solution... I just can't think of it..
And I vaguely remember the function name that I used...
R
Solved!
Go to Solution.

Thanks,
I should have mentionned that the token in this case is a backspace '\b' character.
The idea is to remove all backspace characters and the character preceding it.
R
Here's a sample of the data:
[Counting] erozurozefozerczeroberozurozefozerczerobNumber of test Errors: 0

Similar Messages

  • How to extract sub string value from a string?

    Hi,
    I need to know how can i extract sub strings from a main
    string, something like this:
    main variable-------->"2087-5E2SE-19-JG7BC"
    i want to split it into like this:
    sub_main_1 variable---------> "2087"
    sub_main_2 variable---------> "5E2SE"
    sub_main_2 variable---------> "19"
    sub_main_2 variable---------> "JG7BC"
    I did the same in flash by using Split and arrays, like this:
    var my_str:String = "2087-5E2SE-19-JG7BC";
    var my_array:Array = my_str.split("-");
    for (var i = 0; i<my_array.length; i++) {
    trace(my_array
    this.aaa1 = my_array[1];
    this.aaa2 = my_array[2];
    this.aaa3 = my_array[3];
    this.aaa4 = my_array[4];
    My question is that how can i do the same in director ?? i
    haven't find any split function in director.
    Thanks in advance,
    Amir

    You do a similar thing in Director using the itemDelimiter,
    which is a
    _player object property in MX2004. By default, it's a comma:
    put _player.itemDelimiter
    It will let you get specific items within a string.
    p = "2087-5E2SE-19-JG7BC"
    _player.itemDelimiter = "-"
    put p.item[1]
    -- "2087"
    You could use it to write yourself a little split function:
    on split(theString, theDelimiter)
    oldDelim = _player.itemDelimiter
    _player.itemDelimiter = theDelimiter
    itemList = []
    repeat with cnt = 1 to theString.item.count
    itemList.add(theString.item[cnt])
    end repeat
    return itemList
    end
    p = "2087-5E2SE-19-JG7BC"
    a = split(p, "-")
    put a
    -- ["2087", "5E2SE", "19", "JG7BC"]
    Dave -
    Adobe Community Expert
    www.blurredistinction.com
    http://www.adobe.com/communities/experts/

  • Data extraction from string

    I'm trying to search a particular value in a string file. The string contains many parameters followed by their values and units. I want to identify and extract, as a number, the value of a particular parameter. The program will basically ask the user to type in (or select from a list of given) parameters in a dialogue box. Then it should display the value of the parameter.
    The string I'm trying to work with, is of the form:-
    SensorOneInMM,34585
    BatteryVoltageInmV,19761
    BattTemp1InC,20
    CliffDistanceLeftInMM,60
    CliffDistanceRightInMM,60
    RightSensor,0
    LeftSensor,0
    CurrentInmAforMotor, 789
    TestingCurrentInmA, 123
    Temp1InC,28
    Temp2InC,28
    BaseCurrentInmA,1342
    ChargeInmV,218
    CurrentInmA,9999
    NotConnected3,0
    Now, for example the value I want to read is the one in Blue color. But the expression, "CurrentInmA" appears several times, in the string. How can I identify the value of the parameter in Blue color??
    Thanks for helping out an amateur!!!
    Cheers.

    Rajat
    I think  you want to extract the value from specific string..
    you can get number of post releted to your question...few are follow
    Post 1
    Post2
    also see attached vi which specific to your problem..
    Attachments:
    Extract frm string.png ‏21 KB

  • How does "Unflatten From String" take a type and return a value of that type?

    http://zone.ni.com/reference/en-XX/help/371361E-01/glang/unflatten_from_string/
    How exactly does the "type" argument for "Unflatten From String" work? I need to create a VI that takes a type, passes it as an argument to several calls of the "Unflatten From String" function, and returns an array containing elements of the type originally passed. The "Unflatten From String" function seems to do some magic though, because the type of the "value" that it outputs changes depending on the type it is passed as input. How do I do the same magic in my VI?
    Ultimately, what I need to accomplish is an unflatten-list operation. Given a type T and a byte string of length L (which contains a concatenation of T elements that are flattened to their bytes), create a VI that unflattens all the types in the string and return an array of length (L / sizeof(T)) that contains each type.
    Note: performing the unflatten-list operation is trivial, but I cannot for the life of me figure out how to do it in a VI that takes a type and returns an array of the appropriate type. By the way, my data is being given to me from another source, so please don't bother suggesting that I should be flattening an array using LabVIEW's "Flatten To String" function in the first place. My data is not given in LabVIEW's array format: http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/flattened_data/
    Thanks a ton!
    -Wakka

    Take a look at this example:  You can see that the flattened string contains several bytes.  The first four bytes contain the length of array (number of elements).  Since the data type is U32, the next 32 bits (4 bytes) contains the value of the first element, and so on.  Could you possibly use this scheme to do what you want to do?  Other data types present different outputs.  You would have to experiment with them.
    - tbob
    Inventor of the WORM Global

  • Reading Hex data- how to typecast from string

    Hi,
    I am reading a file having hex data ( say 100 lines).When i read it i think it is being read as a string.
    How can i typecast or convert it to int .
    I am using dis.readLine() to read from file and assigning it to a variable(int).
    Thanks.
    Edited by: Motorcycle on Jun 10, 2009 3:16 PM

    Sorry for that..:)
    ok a few lines of the file are as folloes
    0x004D1202
    0x0002E1E5
    0x004C1202
    0x0002E1EB
    0x004E1202
    I tried reading it as data [indr][indc].tag = ( int ) dis.readLine() ;
    It said " cannot convert from String to int.
    data is a structure having int variables.
    Thanks.

  • How to EXTRACT from one PHOTO to another

    How do I extract from one photo and place in another using PSE 19
    Message title was edited by: Brett N

    You probably mean PSE10 ---Typo?
    Use one of the selection tools, e.g. selection brush, lasso tool, to select the object on picture A.
    Go to Edit>copy to put it on the clipboard
    Open picture B
    Go to Edit>paste. A will be on its own layer
    Access the move tool to position A and to resize with the corner handles of the bounding box

  • NPD Metrics - how to extract from the database in a usable format

    Metrics for NPD activities and projects are stored in the database one row for each metric in each activity or project instance. If there are multiple metrics per activity instance, for example, extraction of those metrics yeilds only a list of metrics and values. I'd like to see it in more of a table style output. Can you provide some guidance on how to extract this from the DB using sql? Thx

    Here is the SQL that should help understand the structure. There are a few ways to pull this data in more of a column based approach. This should help you get started.
    select modml.baseName as MetricName, bases.name as Basis, ph.name as Phase,
    fy.name as FiscalYear, gl.Value as Value, UOM.ID as UOM, currml.Name as Currency
    from plmFieldExchangeGlobals gl
    inner join plmFieldExchangeDefinitions fed on fed.pkid = gl.FieldExchangeDefinitionPKID
    inner join plmFieldExchangeDefModels mod on mod.pkid = fed.fkFieldExchangeDefinitionModel
    inner join plmFieldExchDefinitionModelML modml on modml.fkFieldExchangeDefinitionModel = mod.pkid and modml.langID = 0
    inner join plmFieldExchangeBases bases on fed.fkFieldExchangeBasis = bases.pkid and bases.langID = 0
    inner join plmFieldExchangePhases ph on fed.fkFieldExchangePhase = ph.pkid and ph.langID = 0
    inner join plmFieldExchangeFiscalYears fy on fed.fkFieldExchangeFiscalYear = fy.pkid and fy.langID = 0
    left outer join UOM on UOM.pkid = mod.fkCommonUOM
    left outer join commonCurrenciesML currml on currml.fkCurrency = mod.fkCommonCurrency and currml.langID = 0
    where ProjectPKID = '320219992047-072a-4698-a553-de5ec124ff9c';
    Segal

  • How to Extract From Pool Tables

    Hi All,
    Can Somebody help with the Detailed Description how to extract the Data from Pool Tables from ECC to SAP BW
    Thanks
    Sam

    Option 1
    Create Infoset SQ02  on those tables and RSO2 - create generic ds
    Option 2 :Create functional Module and create generic ds using FM
    Replicate DS to BW and Build objects and map them in transformations and create dtp and IP
    Start extraction! .. please search for detailed steps in forum

  • Xpath in BPEL: How to extract from message type to string

    Hi all,
    I am currently trying to extract all content from a special message type to a string. The special message is really just simple XML.
    However, I wish to convert the special domain specific message to a string to send to another partnerlink.
    I figured that it would be a simple matter of using an assign / copy operation using the special message and the ora:getContentAsString function.
    This does not work :-(
    I get the following error in the domain log:
    ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessage"; the exception is: XPath expression failed to execute.
    Error while processing xpath expression, the expression is "ora:getContentAsString(bpws:getVariableData('businessEventBody'))", the reason is FOTY0001: type error.
    Please verify the xpath query.
    Does anyone have any ideas on how to solve this?
    Regards,
    Aagaard

    <p>
    Hi,
    </p>
    <p>
    Let me explain the scenerio:
    </p>
    <p>
    I XSD I have is:
    </p>
    <p>
    &lt;xs:schema xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"
    targetNamespace="**************"
    &lt;xs:element name="OrdDesc"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="ord" type="number10" /&gt;
    &lt;xs:element name="ord_name" type="varchar2150" /&gt;
    &lt;xs:element name=ord_add1" type="varchar2240" minOccurs="0" /&gt;<br /><br /> &lt;xs:element name="ord_add2" type="varchar2240" minOccurs="0" /&gt;<br /><br /> &lt;xs:element name="ord_city" type="varchar2120" minOccurs="0" /&gt;<br /><br /> &lt;xs:element name="county" type="varchar2250" minOccurs="0" /&gt;<br /><br /> &lt;/xs:sequence&gt;<br /><br /> &lt;/xs:complexType&gt;<br /><br /> &lt;/xs:element&gt;<br /><br />&lt;/xs:schema&gt;<br /></p><br /><p><br /><br /><br />The runtime XML I would get:<br /></p><br /><p><br /><br /><br />&lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br /><br />&lt;Messages&gt;<br /><br /> &lt;Message&gt;<br /><br /> &lt;family&gt;New&lt;/family&gt;<br /><br /> &lt;type&gt;OrderCreate&lt;/type&gt;<br /><br /> &lt;id&gt;22&lt;/id&gt;<br /><br /> &lt;messageID/&gt;<br /><br /> &lt;routingInfo/&gt;<br /><br /> &lt;messageData&gt;&lt;![CDATA[&lt;!DOCTYPE *************"&gt;<br /><br /> &lt;OrdDesc&gt;<br /><br />  &lt;ord&gt;22&lt;/wh&gt;<br /><br />  &lt;ord_name&gt;Ord1&lt;/wh_name&gt;<br /><br />  &lt;ord_add1&gt;Park Avenue&lt;/wh_add1&gt;<br /><br />  &lt;ord_add2/&gt;<br /><br />  &lt;ord_city&gt;XYZ&lt;/wh_city&gt;<br /><br />  &lt;county/&gt;<br /><br /> &lt;/OrdDesc&gt;]]&gt;&lt;/messageData&gt;<br /><br /> &lt;/Message&gt;<br /><br /> &lt;Message&gt;<br /><br /> &lt;family&gt;New&lt;/family&gt;<br /><br /> &lt;type&gt;OrderMod&lt;/type&gt;<br /><br /> &lt;id&gt;22&lt;/id&gt;<br /><br /> &lt;messageID/&gt;<br /><br /> &lt;routingInfo/&gt;<br /><br /> &lt;messageData&gt;&lt;![CDATA[&lt;!DOCTYPE *************"&gt;<br /><br /> &lt;OrdDesc&gt;<br /><br />  &lt;ord&gt;22&lt;/wh&gt;<br /><br />  &lt;ord_name&gt;Ord1&lt;/wh_name&gt;<br /><br />  &lt;ord_add1&gt;Park Avenue&lt;/wh_add1&gt;<br /><br />  &lt;ord_add2/&gt;<br /><br />  &lt;ord_city&gt;XYZ&lt;/wh_city&gt;<br /><br />  &lt;county/&gt;<br /><br /> &lt;/OrdDesc&gt;]]&gt;&lt;/messageData&gt;<br /><br /> &lt;/Message&gt;<br /><br />&lt;/Messages&gt;<br /></p><br /><p><br /><br /><br />Now, the Msg type(&lt;type&gt;OrderCreate&lt;/type&gt;) I am referring to is not the part of XSD, it gets generated at the time message is created. That's why I don't see that tag in the payload. Payload shows the elements of XSD. <br /></p><br /><p><br /><br /><br /><br /><br />Please help.<br /></p>

  • How to extract from a string ?

    Hello , I have this string and I need to extract 4 parts (in bold) from the string , my string is :
    '(invoice) dear client : tom cruise you Buy *408* from MENA.CA @ *6.93* 01/10/09 watheeqa'
    What is the best technique to do that?
    Thanks

    Hi,
    oais wrote:
    Hello , I have this string and I need to extract 4 parts (in bold) from the string , my string is :
    '(invoice) dear client : tom cruise you Buy *408* from MENA.CA @ *6.93* 01/10/09 watheeqa'
    What is the best technique to do that?
    ThanksThat depends on how you know the 4 parts are what you showed, and not
    '<b>(invoice) dear client: tom</b> cruise you Buy 408 from MENA.CA @ 6.93 01/10/09 watheeqa'
    or
    '<b>(invoice)</b> dear client: <b>tom cruise</b> you Buy 408 from MENA.CA <b>@</b> 6.93 01/10/09 <b>watheeqa</b>?'
    or
    '(invoice) dear client: <b>tom cruise</b> you Buy 408 from MENA.CA @ 6.93 <b>01/10/09 watheeqa</b>'
    Will there always be exactly four parts you need to pick?

  • How to extract a string value from a varchar column

    Hi,
    I've a varchar2 column which has got xml data. I want to extract the value of some tag <test></test>
    I can't use EXTRACT as the column is not XMLTYPE.
    Please suggest.

    Hi,
    make a new temporary table table wirth columns as the same name as TAGS in your XML.
    extract the XML in a temporary variable.
    pass it to the below proc with the table name created in step1 , it will populate the temporary table with the XML data.
    PROCEDURE prc_save_xml(
    iv_table_name IN VARCHAR2,
    ic_xmlstring IN CLOB,
    on_count OUT NUMBER,
    ov_remarks OUT VARCHAR2,
    ov_status OUT VARCHAR2,
    iv_row_tag IN VARCHAR2 DEFAULT 'ROW'
    ) IS
    insctx dbms_xmlsave.ctxtype;
    doc CLOB;
    BEGIN
    --Get a context handle
    insctx := dbms_xmlsave.newcontext(iv_table_name);
    dbms_xmlsave.setdateformat(insctx, 'YYYYMMDD');
    dbms_xmlsave.setrowtag(insctx, iv_row_tag);
    ov_remarks := 'Inserting now';
    on_count := dbms_xmlsave.insertxml(insctx, ic_xmlstring);
    ov_remarks := 'Inserted now';
    dbms_xmlsave.closecontext(insctx);
    --set return status as Success
    ov_remarks := 'Sucess';
    ov_status := gv_success;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.put_line('IN OTHERS :' || SQLERRM);
    ov_status := gv_failure;
    ov_remarks := ov_remarks || ':' || SQLERRM;
    on_count := 0;
    END prc_save_xml;

  • How to extract from dll

    I have created a dll file and i have stored an image file in it. I want to extract it i mean i want to use it in my program now what should i do to extract that image file from dll.

    I have created a dll file and i have stored an image file in it. Why?
    I want to extract it i mean i want to use
    it in my program now what should i do to extract that
    image file from dll.How would you normally extract an imagine from a dll. If you don't know, I suggest you not put it in the dll.

  • Extracting from String

    Hi,
    if i have a String like 'M[ey]er' how could i extract all information that is not within the brackets so it would give me 'Mer' then ?
    Thanks,

    Hi ,
    Modified <b>...works with string</b> also...
    data:
    w_string type string value 'ram[mohan]hh[rao]kkk[ram]h[nagam]',
    w_len type i,
    w_cnt type i.
    data:
    w_output type string ,
    w_temp type string.
    data:
    itab like standard table of w_string with header line.
    translate w_string to upper case.
    w_len = strlen( w_string ).
    do w_len times.
    w_cnt = sy-index - 1.
    if w_string+w_cnt(1) na sy-abcde.
        concatenate w_temp ']'  into w_temp.
    else.
        concatenate w_temp w_string+w_cnt(1)  into w_temp.
    endif.
    enddo.
    w_string = w_temp.
    split w_string at ']' into table itab.
    loop at itab .
      w_cnt = sy-tabix mod 2.
      if w_cnt eq 1.
        w_len = strlen( itab ).
        if w_len = 1.
          w_temp = '[?]'.
        else.
        w_temp = '[*]'.
        endif.
      else.
        w_temp = itab.
      endif.
      concatenate w_output w_temp into w_output.
      clear w_temp.
    endloop.
      write: w_output.

  • How to extract from XMLType

    hi
    I have XMLType field in DB. I must select data from this field but I am getting an error.
              OracleCallableStatement st = (OracleCallableStatement)conn.prepareCall (xmlQuery);
                    ResultSet res = st.executeQuery();       
                XMLType  xmltype =null;
                OracleResultSet rs = (OracleResultSet) st.executeQuery(xmlQuery);
                while(rs.next()){
                                            xmltype =(XMLType) rs.getObject("candidate_details");
                            xmltype.extract("/name/text()","/employee").getStringVal();
                           I am getting the following exception:
    java.sql.SQLException
         at oracle.xdb.XMLType.extract(XMLType.java:1427)
         at samplexmltype.XMLTypeForm.btnRead_actionPerformed(XMLTypeForm.java:494)
         at samplexmltype.XMLTypeForm.mav$btnRead_actionPerformed(XMLTypeForm.java)

    If retval contains the whole response including envelope, then obviously it doesn't start at "TICKETCreateRespMsg". You have to use the full path, or a descendant axis, but the former is preferred.
    Be aware of namespaces too, that's a common gotcha with XML.
    SQL> set serveroutput on
    SQL>
    SQL> DECLARE
      2 
      3    retval xmltype := xmltype('<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      4  <env:Header/>
      5  <env:Body>
      6  <TICKETCreateRespMsg xmlns="http://www.testurl.com/webservices/">
      7  <body xmlns="">
      8  <CreateTicket>
      9  <TICKET_NO>A-32758628</TICKET_NO>
    10  <SUMMARY>Test1</SUMMARY>
    11  <ERROR_MSG>Test2</ERROR_MSG>
    12  </CreateTicket>
    13  </body>
    14  </TICKETCreateRespMsg>
    15  </env:Body>
    16  </env:Envelope>');
    17 
    18    v_ticket_no varchar2(30);
    19    v_summary   varchar2(30);
    20    v_error_msg varchar2(30);
    21 
    22    v_ns_map    varchar2(200) := 'xmlns:env="http://schemas.xmlsoap.org/soap/envelope/", xmlns:ns1="http://www.testurl.com/webservices/"';
    23    v_xpath     varchar2(200) := '/env:Envelope/env:Body/ns1:TICKETCreateRespMsg/body/CreateTicket';
    24 
    25 
    26  BEGIN
    27 
    28   SELECT extractValue(retval, v_xpath || '/TICKET_NO', v_ns_map)
    29        , extractValue(retval, v_xpath || '/SUMMARY', v_ns_map)
    30        , extractValue(retval, v_xpath || '/ERROR_MSG', v_ns_map)
    31   INTO v_ticket_no, v_summary, v_error_msg
    32   FROM dual;
    33 
    34   dbms_output.put_line('TICKET_NO = '||v_ticket_no);
    35   dbms_output.put_line('SUMMARY = '||v_summary);
    36   dbms_output.put_line('ERROR_MSG = '||v_error_msg);
    37 
    38  END;
    39  /
    TICKET_NO = A-32758628
    SUMMARY = Test1
    ERROR_MSG = Test2
    PL/SQL procedure successfully completedEdited by: odie_63 on 17 avr. 2012 13:07

  • How to extract from the exception the reason for the failure

    I have a method that executes an sql update and fails.
    The description of the failure is:
    com.ibm.websphere.ce.cm.DuplicateKeyException: One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "1" constrains table "XXX" from having duplicate rows for those columns.
    I didn't find a way of extracting the type of the exception (if there's one).
    I want to be able to assess the exception and to return a specific error message with
    the specific error explained.
    thanks
    Itamar

    One can alway catch the exceptions (java.sql.SQLException) and call its getErrorCode() method,
    but getMessage or getLocalizedMessage are fine also.
    In your case you have primary fields or indexes that require uniqueness of some fields across records.
    For instance if you have a composed primary key id+language and forget to INSERT the language.
    Off course you find the spot in the code by:
    try {
    } catch (....Exception e) {
        e.printStackTrace();
    }Another preventive way is to use PreparedStatements.

Maybe you are looking for