Extract the string from the chain - separator = ' | '?

Hi people!

I want to know how to extract the a string with delimiter = XE field ' |'.

For example:
String = "field1 |" Field2 |... | fieldX |... | filedn | »

I want to extract fieldX.

Thanks for your help, regards.

Use the functions like this substr and instr

substr(string, instr( string,'|', 1, xth_occurrence)+1, instr( string,'|', 1,xth_occurrence+1) - instr(string,'|', 1, xth_occurrence))

Luca

Please, mark the reply as useful/correct if it is

Published by: Luka on January 26, 2010 10:42

Published by: Luka on January 26, 2010 10:42

Tags: Database

Similar Questions

  • How to extract a string from a TextRange

    Dear Experts,

    How can I retrieve the string "=? UTF - 8? B? LDvGhsLCBGcmybYk? ="between the markers of coding?

    Currently, I am able with the help of code as

    \starttext = activeDoc.Find (startText.beg, findParams);

    to find the exact begins and demand an end to the chain and I created the Base64TextTextRange.

    With the statement activeDoc.TextSelection = Base64Text; I can highlight the text in my document.

    I tried further with

    Base64Item = activeDoc.GetTextForRange(Base64Text,Constants.FTI_String);

    Base64String = Base64Item.toString ();

    But still, I am not able to see the string in the object of the Toolbox browser.

    Note that I do not use the GetText method because the string is only part of the paragraph.

    Thanks for the tips.

    The GetText method, you get an array of text elements. You need to assemble the parts of the string of the text element of individual objects in a single string, then fing encoding markers. Assuming that your Base64Text is a range of valid text, your code should look like this:

    var saTextItems = activeDoc.GetTextForRange (Base64Text, Constants.FTI_String);

    var i;

    var sFullText = ";

    for (i = 0; i< satextitems.length;="" i++="">

    sFullText += saTextItems [i] .sdata;

    var iPos1 = sFullText.indexOf ("=?") + 2 ;    / * assuming =? is the beginning marker and adding 2 to point to the first position behind it * /.

    var iPos2 = sFullText.indexOf ('? ') =", iPos1);   / * Add the start shifted for good measure, but that may not be required here * /.

    var sBase64String = sFullText.substring (iPos1, iPos2);

    Alert (sBase64String);

    I would like to know if it works for you. And mark the answer as correct if it does.

  • How to extract a string from a varchar column value

    Hello
    I have a varchar2 column that got the xml data. I want to extract the value of a tag < test > < / test >

    I can't use EXTRACT because the column is not XMLTYPE.

    Please suggest.

    Insert first only the first two columns:

    INSERT INTO TESTXML (id,name) VALUES(1, 'ABCDEFTEST');
    INSERT INTO TESTXML (id,name) VALUES(2, 'XYZUVWTEST');
    INSERT INTO TESTXML (id,name) VALUES(2, 'XYZUVWTES');
    

    Make this update:

    update testxml set temp=rtrim(ltrim(regexp_substr(name,'(.*?)'),''),'');
    

    Edited by: hartmutm the 01.10.2010 05:13

  • extract a string from a string

    Hello

    Wanted to still know a thing in obiee 11g
    If I need to do something like this

    a String-> [email protected]
    and I need to take the abc's of him.
    So how do.

    I thought to use SUBSTRING (long expr FOR startPos)
    as stratPos is 1, then the length is 1 @-1
    but then is there an instr function in obiee?

    Thank you

    Try this:

    LEFT (tablename.columnname, LOCATE('@', tablename.columnname)-1)

  • Separated from the chain and chart

    Hello

    I work in LabVIEW 13. I get a string from a robot in this format: "[X, Y, Z]," where X, Y, Z are numbers that vary in character count. I am wanting to split these 3 double channels separated with just the numeric values (i.e. remove the square brackets and commas) and then graphic error between the ordered position data vs the returned position data. I looked at the search and replace and split strings of vi, but I'm kind of confused on how to use them properly.

    Can someone point me in the right direction for the first split the strings and graphics then the numbers?

    Thank you

    SM

    Graphic, I think you can figure out to play around with the numbers. To help you get started, here's how would you use string analysis for 3 numbers:

    If you are just graphical error between actual and theoretical, it's easy. Get the XYZ difference between two points, and then perform a calculation of Pythagorean theorem on the resulting vector.

  • Extract the string from the string

    Hello guys,.

    I have a small question. I would like to extract a string to another string. Imagine the following string:

    param1 = value1 param2 = value2, param3 = value3, param4 = value4

    I would like to be able to extract value2 and value3 to this string. I know that the design of the db is not perfect and should be like this. but it is historical and I have to use this way. Any suggestion?

    Thank you

    to retrieve param2

    Select

    substr (s

    , instr (s, '=', 1, 2) + 1

    , instr (s, ',', 1, 2) - instr (s, '=', 1, 2) - 1

    ) r

    from (select "param1 = value1 param2 = value2, param3 = value3, param4 = value4's double)

    or

    Select regexp_substr (your_string, "[^,] +' 1, 4") from your_table

    for example

    Select regexp_substr ("param1 = value1 param2 = value2, param3 = value3, param4 = value4 ',' [^,] +' 1, 4") param2 double

    PARAM2

    'value2 '.

    Post edited by: chris227
    Corrected solution substr (sorry was before the first coffee ;-))

  • What is the chain to retrieve VirtualKeyboardControl from BlackBerryCanvas via getControl (String)?

    What is the chain needed to retrieve the BlackBerryCanvas VirtualKeyboardControl using getControl (String)?

    String vkbControlString = '? ';

    VirtualKeyboardControl vkbctrl = (VirtualKeyboardControl) getControl (vkbControlString);

    THX

    Thanks Mark.

    I've tested this and it worked as expected:

    Control control = getControl("net.rim.device.api.lcdui.control.VirtualKeyboardControl");
    if (control instanceof VirtualKeyboardControl) {
        vkbControl = (VirtualKeyboardControl)control;
    }
    

    Missed me the fully qualified name of the class.

  • Extraction of fixed phone number valid in the chain

    Hello

    We have field Phone_Number where data from the source system are as below:

    OFFICE: 026346644 # MOBILE: 0506212159

    MOBILE: 055-4705510 # OFFICE: 06-5035522/530

    Problem - we need to extract the valid landline phone number United Arab Emirates UNITED string ignoring the remaining details. Guys like 'OFFICE', ' MOBILE in the data are not significant and should not be considered. Even if the chain has several fixed phone number valid UNITED Arab Emirates, from 1 single value among them.

    Approach: We use regular expression check with 'Match list contains' but check only works on any value and not on the substring or part of the chain. Please suggest.

    Thank you

    Amol

    Hello Amol,

    Control RegEx is an 'Audit' processor then it will only tell you if a value passes or fails a control. If you want to return a value [i.e. phone number retrieves] then you will need to use the replacement of match or regex regex. Yes, regex to works on the entire chain, so you will need to write your regular expression as a result to find the phone number in among other content by using a capture group [Regex Tutorial - parentheses for grouping and capture]

    Thank you

    Nick

  • I'm trying to extract the strings and load them into a text-helpplease file

    I'm trying to extract the strings and load them into a file text without space between them - see below

    p_csa = ISCC M4 DP

    where p_csa is a tring to load into a text file



    Code:

    SELECT SUBSTR (p_csa, 0, 0) INTO v_telco FROM DUAL;
    SELECT SUBSTR (p_csa, 1, 4) INTO v_comp FROM DUAL;
    SELECT SUBSTR (p_csa, 5.3) INTO v_csa_prefix FROM DUAL;
    SELECT SUBSTR (p_csa, 8, 4) INTO v_csa_type FROM DUAL;

    fileidinvoice: = UTL_FILE. FOPEN (c_data_location, filenameinvoice, 'W');
    fileidlog: = UTL_FILE. FOPEN (c_data_location, filenamelog, 'W');

    UTL_FILE. PUT_LINE)
    fileidinvoice, v_telco | » '|| v_comp | "|" | v_csa_prefix: "| v_csa_type);


    -the content of the file-

    ISCC M4 DP

    =====================
    I want to remove the space between the chain above for the content of the file should look like this:

    -the content of the file-

    GCSIM4DP

    Hello

    976253 wrote:
    I'm trying to extract the strings and load them into a file text without space between them - see below

    p_csa = ISCC M4 DP

    where p_csa is a tring to load into a text file

    Code:

    SELECT SUBSTR (p_csa, 0, 0) INTO v_telco FROM DUAL;

    Is it always NULL?

    SELECT SUBSTR (p_csa, 1, 4) INTO v_comp FROM DUAL;

    You don't need the double table much in PL/SQL. You can simply say

    v_comp := SUBSTR (p_csa, 1, 4);
    

    Almost all integrated single-row functions work in PL/SQL. (NVL2 is the only one I know who does not work in PL/SQL).

    SELECT SUBSTR (p_csa, 5.3) INTO v_csa_prefix FROM DUAL;
    SELECT SUBSTR (p_csa, 8, 4) INTO v_csa_type FROM DUAL;

    fileidinvoice: = UTL_FILE. FOPEN (c_data_location, filenameinvoice, 'W');
    fileidlog: = UTL_FILE. FOPEN (c_data_location, filenamelog, 'W');

    UTL_FILE. PUT_LINE)
    fileidinvoice, v_telco | » '|| v_comp | "|" | v_csa_prefix: "| v_csa_type);

    What are you trying to do here? For example, what you're trying to put between c_comp and v_csa_prefix?

    -the content of the file-

    ISCC M4 DP

    =====================
    I want to remove the space between the chain above for the content of the file should look like this:

    -the content of the file-

    GCSIM4DP

    If you don't want space, then only concatenate all the spaces in the string before you write it and REPLACE allows you to delete all the spaces that have been copied from p_csa. For example:

    UTL_FILE.PUT_LINE ( fileidinvoice
                , REPLACE ( v_telco || v_comp
                                        || v_csa_prefix
                              || v_csa_type
                       , ' '
                       )
                );
    

    I guess you need the v_comp of separate variables, the v_csa_prefix and the v_csa_type for something.

    I hope that answers your question.
    If this isn't the case, after a complete script that people can run to recreate the problem and test their ideas. Display the results you want (in other words, the contents of the file created).
    Always say what version of Oracle you are using (for example, 11.2.0.3.0).
    See the FAQ forum {message identifier: = 9360002}

  • Remove the chain if the match format of other print the same string

    Hello

    I had posted a question earlier before in the forum in lieu of the chain

    > >Delete Sting

    My requirement is user will pass the string that is mentioned below

    > > "SUCCESS [FID__6a377428_137b946b364__767b].

    It should return > > FID__6a377428_137b946b364__767b

    If the user only the > > FID__6a377428_137b946b364__767b

    It should not replace anything, to just return the same string

    logic for this query is it should return the string anything between [] another user that never enter it should return.

    Please suggest me

    I use this query, that it works fine but the user spends FID__6a377428_137b946b364__767b with ouy [] must return the same

    SELECT col1 FROM
    (
    with the data as
    (
    Select trim ('FID_28eff73b_125a3e651e2__7c26') double NECK
    )
    SELECT TRIM ('] ' OF REGEXP_SUBSTR (COL, ' [^ \] +', 1, 2])) COL1
    extracted data);

    Thank you
    Sudhir

    Published by: Sudhir_Meru on June 29, 2012 21:14

    This will work with the sample you provided...

    SQL> with t as
      2  (select 'SUCCESS[FID_28eff73b_125a3e651e2__7d76]' str from dual union all
      3   select '[FID_28eff73b_125a3e651e2__7d76]' str from dual union all
      4   select 'FID_28eff73b_125a3e651e2__7d76' str from dual )
      5  select str,case when str like '%[%]%'
      6                  then regexp_replace(str,'([^\[]?+\[)([^]]+)(].*?)','\2')
      7              else str
      8         end output
      9  from t;
    
    STR                                      OUTPUT
    ---------------------------------------- ----------------------------------------
    SUCCESS[FID_28eff73b_125a3e651e2__7d76]  FID_28eff73b_125a3e651e2__7d76
    [FID_28eff73b_125a3e651e2__7d76]         FID_28eff73b_125a3e651e2__7d76
    FID_28eff73b_125a3e651e2__7d76           FID_28eff73b_125a3e651e2__7d76
    
  • extract the partial string of the string in oracle

    Hello friends,

    I have a string like this

    var str = "/ G/CNH/CNHCornerstone/currentCode/data/Working/Images/ModelImages/png/7402203E-607D-E111-9CA5-005056875BD6.png"

    I want to extract only 7402203E-607D-E111-9CA5-005056875BD6 of the chain.

    Please let me know how to implement this...

    Thank you/kumar

    Published by: kumar73 on April 10, 2012 12:34

    One more using REGEXP_SUBSTR... This should be faster (than the previous REGEXP) because the REGULAR expression is simpler and extracts only the GUID.

    select regexp_substr('/G/CNH/CNHCornerstone/currentCode/data/Working/Images/ModelImages/png/7402203E-607D-E111-9CA5-005056875BD6.png', '[0-9A-F]{8,8}-[0-9A-F]{4,4}-[0-9A-F]{4,4}-[0-9A-F]{4,4}-[0-9A-F]{12,12}') from dual

    You need however to reference that. In addition, it assumes that only the file name is a GUID. If a drectory name is a GUID, then he will find out who "accidentally" instead.

    Published by: dayneo on June 6, 2012 07:35

  • Analyzes the string and extract the string delimiter

    Hello

    Basic questions.  Is this possible with the scan of regular expression of the string to extract the string that are in the specified delimiters.  Here is an example:

    Name of the \\Name of the folder 1\Name to the folder 2\Name to the folder 3\File

    Chain analysis can produce the following by specifying the regular expression on the right:

    1 folder name

    Name of the folder 2

    Name of the folder 3

    File name

    I tried \\\%s\\%s\\%s\\%s but the %s stops on the first white space.

    Thank you

    Michel

    RavensFan suggested the service appropriate for your condition, but you can also use an alternative, which is "spreadsheet of array of strings.

  • Concatenate the strings from VISA

    Hello people,

    I'm still fairly new to LabView, please bear with me.

    I'm interested in doing a Subvi, which will receive bytes on a VISA from serial port and write each line to a greater (concatenated) string, so it can later be stored in a file. In simple terms, I want to save all the data on the serial port for 8 tests to be completed. There will be 6 cases of this in the parent VI, so he needs be modular.

    I expect a series of 8 channels of the source serial communication, each line begins with "Success" or "Failed" then the test. for example:

    Past test1

    Failure of test2

    Past of test3

    Past of test4

    .

    .

    .

    The current method I use must react when there are present bytes in the buffer in series, and then identify a match (currently it only identifies a match of 'Success').

    Is it possible to get a match for the substring to 'Success' OR 'failure '?

    How can I place all these strings on a chain? Concatenation of strings do not work because I'm having the same input string of the VI...

    Any help/input would be welcome, thank you.

    Here is a basic example of using to concatenate strings. Since it is always very difficult to know if you call your Subvi several times or if you call once and want to to read all the results I won't comment much more on it. This example would read all the results and the output format string you want to write to a file later or do whatever you want with it. The basic constructs of what you will need are illustrated here. How to encorporate in your application will be difficult to say without any code beyond the wick you have posted.

  • Extracting the data from QVariantMap

    I have the following data :

    QVariant (QVariantMap, QMap ((' data', QVariant (QVariantMap, QMap ((' current_condition', QVariant (QVariantList, ((QVariantMap, QMap... QVariant QVariant (QVariantMap, QMap ((' weather', QVariant (QVariantList, ((QVariantMap, QMap... QVariant QVariant (QVariantMap, QMap ((' weather_desc', QVariant (QVariantList, ((QVariantMap, QMap... QVariant

    m_model-> insert(data.value() .value ("data") .toMap ().value("weather").toList () .at (0) .toMap ());

    Using the above line, I am able to extract relevant data from "current_condition and"weather".

    What should I add to the line above to also extract data from 'weather_desc '?

    Any help would be appreciated. Thank you.

    Thank you! It is much easier to read when formatted, it's the first thing I did.

    { "data":
      {
        "current_condition":
        [
          {
            "cloudcover": "0",
            "humidity": "18",
            "observation_time": "02:36 AM",
            "precipMM": "0.0",
            "pressure": "1007",
            "temp_C": "39",
            "temp_F": "102",
            "visibility": "10",
            "weatherCode": "113",
            "weatherDesc": [ {"value": "Sunny" } ],
            "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ],
            "winddir16Point": "N",
            "winddirDegree": "10",
            "windspeedKmph": "46",
            "windspeedMiles": "29"
          }
        ],
        "request":
        [
          {
            "query": "Melbourne, Australia",
            "type": "City"
          }
        ],
        "weather":
        [
          {
            "date": "2013-01-04",
            "precipMM": "0.0",
            "tempMaxC": "37",
            "tempMaxF": "98",
            "tempMinC": "19",
            "tempMinF": "66",
            "weatherCode": "113",
            "weatherDesc": [ {"value": "Sunny" } ],
            "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ],
            "winddir16Point": "N",
            "winddirDegree": "3",
            "winddirection": "N",
            "windspeedKmph": "21",
            "windspeedMiles": "13"
          }
        ]
      }
    }
    

    To access weatherDesc in usage by time:

    Data.value.value("data").toMap ().value("weather").toList () .at (0) .toMap ().value("weatherDesc").toList () .at (0) .toMap .value ("value") ())

    This will return "Sunny."

    For readability, I suggest if this string to:

    QMap  dataMap = data.value().value("data").toMap();
    
    QList weatherList = dataMap..value("weather").toList();
    
    QVariant firstWeatherEntry = weatherList.at(0);
    
    QMap weatherEntryMap = firstWeatherEntry.toMap();
    
    QList weatherDescList =
    weatherEntryMap.value("weatherDesc").toList();
    
    QVariant firstWeatherDescEntry = weatherDescList.at(0);
    
    QMap weatherDescEntryMap = firstWeatherDescEntry.toMap();
    
    QString value = weatherDescEntryMap.value("value").toString(); // "Sunny"
    

    Also, you can check intermediate outcomes at each stage by calling

    qDebug()< weatherlist="">< "\n";="" and="" so="">

  • Check if a string contains "text" in a box, and only if it does not, add it to the chain.

    I have some comboboxes. I want a text field to add a channel to itself, that contains the text selected in each combobox. I got it with this:

    var a = this.getField ("CoBi_text");

    for (i = 1; i < 16; i ++) {}

    var t = (this.getField("CoB_"+i).valueAsString);

    Si (t ! = « ») {}

    a.Value += t + ',';   }   }

    But what adds text even though I select the same option in any of the combobox control. How can I include a conditional don't skip the increment if "the text is already in the string?  I tried this:

    If ((t! = «») & & (a.value.indexOf ("t") < 0)) {}

    a.Value += t + ',' ;}

    But it causes the chain add the text first, don't increment not any text more after that.

    PS. This text field will be hidden and later used on another condition (if it contains 'a specific text'), some other triggering actions.
    So the ',' (comma) is probably not necessary, but I think that it should not be in the way of a proper search indexOf (right?)

    Thank you.

    eHRM, nevermind. I got it.

    the "t" inside indexOf should not "s...".

    var a = this.getField ("CoBi_text");

    for (i = 1; i<16;i++)>

    var t = (this.getField("CoB_"+i).valueAsString);

    If ((t! = «») & (a.value.indexOf (t))<0) )="">

    a.Value += t + ',' ;}

    Now, he adds "text", but not more than once for each different text on each drop-down list.

    There is always the question of the modification of a selected item in a combobox control, how do I remove the old text from the text box but I think than any forced recalculation should be enough.

    Thank you for taking the time to respond and for the link!

Maybe you are looking for