Extracting second  part of string

hi
i have a string like abcd~12341sdfs
I have to extract the string after ~ symbol
Please let me know how ot do it

Your same question from last week Extracting a part of Strng.

Similar Messages

  • Extract 2nd part of string

    I have a desc field and I want to extract everything to the right of the hyphen.  Since you can't use substr in CR how can I do it?  Thanks so much in advance!

    There are a few options:
    1. Use Split to split on hyphens and then use the second element in the resulting array
    2. Use inStr to find the location of the hyphen (inStr returns back the index of the desired character in the string being searched) and then use Mid to retrieve all text after that index
    a programmer learning programming from perl is like a chemisty student learning the definition of "exothermic" with dynamite

  • Extracting a part of string

    I have a string like 'abcd1234'. I want to extract only the number part to another variable. I dont know the occurance of the number in the string
    Please help me

    Please read this thread:
    Re: Splitting numbers and alphabets

  • Extract a part of String

    Hi Experts!
        I have a database table in which there is a field 'TEXT' of data type 'STRING'.
        I need to pick up the value behind the field string.
    Field string has entry in this format:-
    <name1><Time-stamp1>## 'some comment' ## 'Some comment1' ##<name2><Time-stamp2>##'Some comment3'##
    ##-signifies the beginning of a new line.
        Now the problem is I need to pick only those values which are the latest, i.e 'some comment' & 'Some comment1'.
       or you can say the comment corresponding to the latest time stamp.
    Please suggest a way out.
    Help will be appreciated.
    Thanks in advance
    Regards
    Sourabh

    Hi
    Try this code:
    DATA: MY_STRING TYPE STRING.
    DATA: BEGIN OF T_COMMENT OCCURS 0,
            LINE(1000),
          END   OF T_COMMENT.
    DATA: LEN TYPE I.
    TEXT-001 is <name1><Time-stamp1>## 'some comment'
    ## 'Some comment1' ##<name2><Time-stamp2>##'Some
    comment3'##
    MOVE TEXT-001 TO MY_STRING.
    SPLIT MY_STRING AT '##' INTO TABLE T_COMMENT.
    LOOP AT T_COMMENT.
      CONDENSE T_COMMENT.
    Check if the first character is '
      IF T_COMMENT-LINE(1) = ''''.
    *...if yes the line is a comment, so write the comment
        LEN = STRLEN( T_COMMENT-LINE ) - 2.
        WRITE: / T_COMMENT-LINE+1(LEN).
      ENDIF.
    ENDLOOP.
    Max

  • String function in Oracle 9i to find part of string having two positions

    Hi,
    We need to extract the part of string having start and end position.
    Like
    Suppose the string is "TYPE ref_cur_type IS REF CURSOR" and need to extract name of the ref cursor i.e ref_cur_type.The length of the output is not fixed. But not able to extract the exact string.
    Thanks,

    What is the criteria for part of string? Do you give start character and end character position like 3,9 etc? Or its just that the word that comes between two spaces?
    Cheers
    Sarma.

  • How Can I extract each part of a string ??

    Dear Sir:
    I have a string like following to connect to Oracle Database:
    JDBC_URL= jdbc:oracle:thin:@localhost:1521:ABChere,
    I have Variables like:
    driverClass="";
    Hostname = "";
    port = "";
    SID="";
    etc
    I try to extract each part from this JDBC_URL,
    then assign them to following variable separately:
    driverClass="jdbc:oracle:thin";
    Hostname = "localhost";
    port = "1521";
    SID="ABC";
    Can some guru help give some good example and show how to do it??
    Thanks and have a nice weekends.

    try using a regular expression (regex).
    here, i am going to try to freeball it:
    // JDBC_URL= jdbc:oracle:thin:@localhost:1521:ABC
    Pattern p = Pattern.compile("(JDBC_URL)(\\s*)(=)(\\s*)(.*?:.*?:.*?)(:)(@)(.*?)(:)(.*?)(:)(.*?)")
    Matcher m = p.matcher(text)
    if(m.matches()) or if(m.lookingAt()){
    String driverclass = m.group(5);
    String hostname = m.group(8);
    ...group(10);
    ...group(12);
    }note that (\\s*) means "any amount of whitespace" and (.*?) means "any amount of any character (reluctantly)".
    i used that because i dont know the constraints on those values. for only numbers you can use (\\d+) etc
    [http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html|http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html]
    also, i put everything into ( ) - which is called a capture group - but that was just to make it clearer. in your final regex you may get
    rid of most of those.

  • Extracting part of string - advice

    Hi Using oracle 11.2.0.3 and looking at somebody else's code
    Folling sql
    SELECT cd_customer_num,cd_postcode,rtrim(substr(CD_POSTCODE, instr(CD_POSTCODE, ' ') + 1), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') postcode_inner
    from customer_details_stg2
    where length(cd_postcode) = 7This code works for nearly all postcodes - attempt is to get the first digit after the space or spaces (could be two spaces betwene dfirst and second part of postcode)
    e.g.
    IP4 1AE gives postcode inner of 1 but postcode DI2 4R1 gives postcode_inner of 4R1
    Not quite sure how above works understand instr, substr etc but bot sure how the ABC... etc gives the right results in most cases.
    An advice on how to get the first numeric digit after the space or spaces and ensure this is only length of 1.
    Many Thanks

    Hi,
    user5716448 wrote:
    ... This code works for nearly all postcodes - attempt is to get the first digit after the space or spaces (could be two spaces betwene dfirst and second part of postcode)
    e.g.
    IP4 1AE gives postcode inner of 1 but postcode DI2 4R1 gives postcode_inner of 4R1Are you saying that '1' is the correct result from 'IP4 1AE', but the result from 'D12 4R1' should be (just) '4'?
    Here's one way:
    SELECT  cd_customer_num
    ,     cd_postcode
    ,     REGEXP_REPLACE ( cd_postcode
                     , '.* \D*(\d).*'
                     , '\1'
                     )     AS postcode_inner
    FROM    customer_details_stg2
    WHERE     LENGTH (cd_postcode) = 7
    ;In the 2nd argument to REGEXP_REPLACE:
    .*       means 0 or more of any characters
    <space>       has no special meaing, it literally means <space>
    \D*       means 0 or more non-digits
    \d       means a digit
    .*       means 0 or more of any characters
    The 3rd argument, '\1', means the expression insiode the 1st set of parentheses.
    So the function will look for a space, followed by a digit, with perhaps some non-digits in between. When it finds that pattern, it will replace it (along with any extra text before or after it) with just the digit.
    Since you're using Oracle 11, you could also do this with REGEXP_SUBST. Sorry, I'm not near an Oracle 11 database now, so I can't test that approach. I'm not sure if it would be any simpler.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Point out where the query above is wrong, and explain how you get the correct results from that data in those places.
    See the forum FAQ {message:id=9360002}

  • Need milli seconds part in XSLT Date Function  current-dateTime()

    Hi All,
    I am calling date function, current-dateTime() in XSL. The output format is 2012-04-05T16:38:01-07:00 (Without milli seconds)
    How to get the milli seconds part...?
    Regards,
    Sudheer

    Hi Arik....
    At last i got it. :)
    Followed the below steps.
    Step1:
    Created a String variable "currentDateTimeValue" in BPEL.
    Step2:
    I have used the below code in JavaEmbedding in BPEL.
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();
    //Date Pattern looks lil weird. But some Web service accepts only this format.
    sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'-00:00'");//2012-04-14T16:24:00.578-00:00
    String formattedDate = sdf.format(new java.util.Date());
    addAuditTrailEntry("Formatted datetime string is: " + formattedDate);
    setVariableData("currentDateTimeValue", formattedDate);
    Step3:
    Created a Simple XSD with an element "DateElement" of String type.
    Step4:
    Assigned "currentDateTimeValue" value to "DateElement" element, in Assign activity.
    Step5:
    Now added this DateElement in Transformation activity, as a second source variable. Mapped this data to the required target element in my XSL.
    uh-huh I got the output...
    Thanks a ton ARIK :D u r really helpful...
    Regards,
    Sudheer

  • RS232 Output Module - Checksum on part of String

    I am running DASYLab 11 and am trying to write a setpoint to a Eurotherm temperature controller via the EI-BISYNCH protocol over RS-232. This requires that I send some control characters and the address of the unit I am commanding, then the some control characters and the new setpoint value, and then an XOR checksum of the second part of the string (control characters + new setpoint). I can't seem to figure out a way to do this, as the /cx format command gives the checksum of the entire string. I tried placing the first part of the string in channel one, the second part and the checksum formatter in channel two, and then selecting sequential output, but that didn't work. Does anyone have any other ideas?
    Thanks for your time!!!
    Solved!
    Go to Solution.

    You will need two different strings... what are your strings? 
    I do have a very happy customer using Eurotherm controllers... but he uses OPC, not RS232.
    the help says this:
    Checksum
    Control Characters
    Description
    Cross sum
    \cq
    Adds all bytes before the checksum character including the contained measurement values and sends the cross sum with the string.
    If the format definition contains a \c control character, DASYLab makes the cross sum from the beginning of the string to the position of the control character. If the format definition contains several \c characters, DASYLab makes the subsequent cross sums from one checksum character to the next.
    CRC test
    \cc
    Calculates all bytes of the string to be sent with the CRC16 method. DASYLab sends the binary sequence of the CRC test and the binary sequence of the CRC test including the CRC value as the result. The sent binary sequence are not numbers but polynomials.
    XOR sum
    \cx
    Connects all bytes before the checksum character including the contained measurement values with the exclusive-or operator and sends the binary sequence with the character string.
    XOR sum with control character suppression
    \cy
    Executes the same operation as the XOR sum and adds 32 to the result byte if the result byte is smaller than 32.
    - cj
    Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.

  • Extract a part from a txt file

    Hi, I've a simple problem which unfortunately can not solve.
    I have some txt's that I want only to extract a part o them. (The first 100 characters). Here is my code:
    import java.io.*;
    public class ReadSource {
         public static void main(String[] arguments) {
            try {
              FileReader file = new FileReader("1.txt");
              BufferedReader buff = new BufferedReader(file);
               boolean eof = false;
               while (!eof) {
                    String line = buff.readLine();
                    if (line == null)
                        eof = true;
                     else{
                     int start = line.indexOf("something");
                     int end = line.indexOf("something_else");
                     String str2 = line.substring(start, end);
                      System.out.println(str2);
                buff.close();
            } catch (IOException e) {
                System.out.println("Error -- " + e.toString());
    }and the error tha java displays is:
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
         at java.lang.String.substring(String.java:1438)
         at ReadSource.main(ReadSource.java:21)
    Exception in thread "main"

    Tim I'm very sorry but is still don't work. It still display the same error.
    Look at my code
    import java.io.*;
    public class ReadSource {
         public static void main(String[] arguments) {
           try {
                   BufferedReader reader = new BufferedReader(new FileReader("1.txt"));
                   BufferedWriter writer = new BufferedWriter(new StringWriter());
                   String line = null;
                   while ((line = reader.readLine()) != null) {
                       writer.write(line);
                       writer.newLine();
                   String content = writer.toString();
                   // Now you have the whole file content into the content String
                   int start = content.indexOf("smth");
                   int end = content.indexOf("smth2");
                   String str2 = content.substring(start,end);
                   System.out.println("start = "+start+", end = "+end);
                   System.out.println(str2);
               reader.close();
         }catch (IOException e) {
                System.out.println("Error -- " + e.toString());
    }It looks very logical, I don't know what happens
    Thank you very much for your help.
    Kostas

  • How to extract local part from email address

    Hello, dear Colleagues.
    Please, help to extract local part from email address.
    Input string: "From: [email protected]"
    Need to get output string between "space" and "@": "C.Norris"
    Thanks.

    Thanks you, mjolinor.
    It works. 
    Could you show me please how to do the same with regular expression?
    Using -replace:
    $InputString = "From: [email protected]"
    $InputString -replace 'From: (.+?)@.+','$1'
    C.Norris
    Using -match:
    $InputString -match 'From: (.+?)@.+' > $null
    $Matches[1]
    C.Norris
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Shuttle - how can I insert data in database from second part of shuttle ?

    I have read it: http://apex.oracle.com/pls/otn/f?p=35253:1:2820687553996558::NO but I don't understand shuttle.
    My shuttle name is 'P3_SHUTTLE'. I have created shuttle by clicking (Create Item -> Shuttle -> next -> etc.). In first part of shuttle I have all elements from some table in database. In second part of shuttle I have choiced elements from first part of shuttle (as in each normal simply shuttle). I would like insert elements from second part of shuttle when somebody clicked button (which I have created). I have created process for this button type PL/SQL anonymous block. In field source of this process I have written:
    DECLARE
    BEGIN
    FOR z in 1..htmldb_application.g_f02.count loop
    INSERT INTO books(id_book) VALUES(htmldb_application.g_f02(z));
    END LOOP;
    END;
    but it doesn't work (I don't know what is 'htmldb_application.g_f02.count' - it was in yours example).
    So I have tried:
    DECLARE
    BEGIN
    FOR z in 1..P3_SHUTTLE.pSQL_2.count loop
    INSERT INTO books(id_book) VALUES(P3_AKTORZY.pSQL_2(z));
    END LOOP;
    END;
    P3_SHUTTLE it is name of my shuttle
    but this code also doesn't work :( HELP please :(
    Edited by: user10728391 on 2008-12-19 01:17
    Edited by: user10728391 on 2008-12-19 01:18

    I have APEX 3.1.2.
    I have tried:
    DECLARE
    l_selected HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    BEGIN
    l_selected := HTMLDB_UTIL.STRING_TO_TABLE(HTMLDB_APPLICATION.G_F02(1));
    FOR I IN 1..l_selected.count
    LOOP
    INSERT INTO BOOKS (ID_BOOK) VALUES (l_selected(I));
    END LOOP;
    END;
    It doesn't work. I have and error: 'No data found'. But you have written about name attribute. In view of code my page with shuttle I have that code about second part of shuttle:
    <td class="shuttleSelect2">
    <select multiple="multiple" name="p_v03" size="10" id="P3_SHUTTLE_RIGHT" ondblclick="g_Shuttlep_v03.remove()">
    <option value="5">Aaa Aaa</option>
    <option value="2">Bbb Bbb</option>
    <option value="1">Eee Eee</option>
    </select>
    </td>
    So I have tried in above code use: HTMLDB_APPLICATION.G_p_v03 and HTMLDB_APPLICATION.p_v03 but I have an error:
    'G_P_V03' must be declared or 'P_V03' must be declared :(
    Edited by: user10728391 on 2008-12-19 02:35

  • Part of  string

    [email protected]; [email protected],
    if I only want first part of string, I meant before ;
    is that split is the only way to handle this case?

    using split is the easiest way.
    use something like this
    &test = "[email protected];[email protected]";
    &array = Split(&test, ";");
    for &i = 1 to &array.Len
    &email = &array[&i];
    /* Do some processing */
    end-for;
    if you do not want to use split try using the following
    &string = "[email protected];[email protected];[email protected];";
    While Find(";", &string) != 0
    &pos = Find(";", &string);
    &email = Substring(&string, 1, &pos - 1);
    &string = Substring(&string, &pos + 1, Len(&string) - &pos);
    End-While;
    Really, there are a lot of different possibilities of achieving what you want ...
    Edited by: Hakan Biroglu on Jul 10, 2012 4:15 PM

  • I am trying to download Elements 12. I've downloaded the two parts on your web site but when I run the second part it comes up with a message saying 'The file archive part of Adobe Photoshp Elements 12 is missing...'. What shoudl I do?

    I am trying to download Elements 12. I've downloaded the two parts on your web site but when I run the second part it comes up with a message saying 'The file archive part of Adobe Photoshp Elements 12 is missing...'. What should I do?

    Hello
    I’ve managed to get it to work now but not as straightforward as I’d have liked and difficult to find out how to get help.
    Rory

  • Hi, I have a refurbished upgraded macbook with 320 GB Disk, 4GB Memory and running Lion OS v 10.7.5.  This satisfies the second part of the requirement for installing OS X Mavericks (10.9) but happens to be an early 2008 piece.  Can I somehow install 10.9

    Hi, I have a refurbished upgraded macbook with 320 GB Disk, 4GB Memory and running Lion OS v 10.7.5.  This satisfies the second part of the requirement for installing OS X Mavericks (10.9) but happens to be an early 2008 piece.  Can I somehow install 10.9?  And why is apple not allowing people like me to try out this installation?  Any reason that are too technical that people like me cannot upgrade and handle?
    This would solve many apps to run on this.

    It's mainly the video card. The Models 2,1 through 4,1 have video cards with non-upgradeable 32bit drivers. The model 5,1 Late 2008 and newer have at least the NVIDIA GeForce 9400M with 64bit drivers. Mountain Lion and Mavericks require 64bit native drivers. Mountain Lion and Mavericks no longer support Intel's GMA 950 or GMA X3100 graphics processors.
    While Lion used some 32 bit and a lot of 64 bit code, Mountain Lion and Mavericks are pure 64 bit, which excludes more systems than Lion did. It's not something you can add memory to, for example, as it involves the base architecture.
    http://reviews.cnet.com/8301-13727_7-57470261-263/older-64-bit-macs-out-of-the-p icture-for-mountain-lion/?tag=mncol;txt
      http://reviews.cnet.com/8301-13727_7-57387846-263/will-your-mac-run-mountain-lio n/   

Maybe you are looking for

  • Quicktime is not showing up in my system preferences?

    I'm having a problem of seeing the question mark where a movie should be.  According to this site http://www.boutell.com/newfaq/browser/bluequestionmark.html I'm to go to System Preferences and then select Quicktime advanced tab. The problem is that

  • Problem in using BAPI_TRLSRVAPS_SAVEMULTI to create transportation lanes

    Hi,   While using BAPI_TRLSRVAPS_SAVEMULTI to create transportation lanes,bapi returns errors 1.Product transportation lane not found in database or in the tables and 2.Product <matnr> ( coming from the flat file in the program ) cannot be both produ

  • Which Business Functions should be activated for China? (We have EHP6)

    Hi Gurus, We are in the process of planning SAP Rollout SD/FI/CO to China. Which Business Functions are typical to be activated for using SAP in China? (We have SAP ERP with EHP6) Thanks+Regards Dieter

  • How to make only vertical scrollbar?

    my codes are shown as the following 2 classes: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JScrollPane.*; class showConsole2{ public static void main(String argv[])throws Throwable{ consoleFrame csf = new cons

  • Lun Masking

    Hello I have an xserve raid (firmware 1.5.1/1.5.1.c) configured with 3 slices and Lun Masking which 3 xserves connect to. They are all attached to a qlogic fc switch. Recently the company bought 2 more servers to support another area and they need th