Parsing out numbers

Trying to parse out the number strings into its own columns with this expression:
WITH T as
(SELECT  '53-2010-2-101' test_string FROM DUAL union all
SELECT  '2219-2010-3-22' FROM DUAL union all
SELECT  '236350-2010-4-3' FROM DUAL)
SELECT SUBSTR(test_string,INSTR(test_string,'-')-2) stu_id,   --This is incorrect
SUBSTR(test_string,INSTR(test_string,'-',1,1)+1,4) fiscal_yr, 
SUBSTR(test_string,INSTR(test_string,'-',1,2)+1,1) sess,      
SUBSTR(test_string,INSTR(test_string,'-',1,3)+1,5) sch_id     
FROM THaving problems with stu_id. How to count backwards with substr and instr? The results should look like so:
STU_ID                         FISCAL_YR                     SESS                                        SCH_ID
53                             2010                           2                                           101
2219                         2010                           3                                            22
236350                         2010                           4                                             3Thanks

Would it be something like this?
WITH T as
(SELECT  '53-2010-2-101' test_string FROM DUAL union all
SELECT  '2219-2010-3-22' FROM DUAL union all
SELECT  '236350-2010-4-3' FROM DUAL)
-- end of sample data
SELECT substr(test_string, 1, instr(test_string, '-') - 1) stu_id,
        substr(test_string, instr(test_string, '-', 1, 1) + 1, 4) fiscal_yr,
        substr(test_string,
               instr(test_string, '-', 1, 2) + 1,
               instr(test_string, '-', 1, 3) - instr(test_string, '-', 1, 2) - 1) sess,
        substr(test_string, instr(test_string, '-', 1, 3) + 1, 5) sch_id
   FROM tSample execution:
SQL> WITH T as
  2  (SELECT  '53-2010-2-101' test_string FROM DUAL union all
  3   SELECT  '2219-2010-3-22' FROM DUAL union all
  4   SELECT  '236350-2010-4-3' FROM DUAL)
  5   -- end of sample data
  6   SELECT substr(test_string, 1, instr(test_string, '-') - 1) stu_id,
  7          substr(test_string, instr(test_string, '-', 1, 1) + 1, 4) fiscal_yr,
  8          substr(test_string,
  9                 instr(test_string, '-', 1, 2) + 1,
10                 instr(test_string, '-', 1, 3) - instr(test_string, '-', 1, 2) - 1) sess,
11          substr(test_string, instr(test_string, '-', 1, 3) + 1, 5) sch_id
12     FROM t;
STU_ID          FISCAL_YR SESS            SCH_ID
53              2010      2               101
2219            2010      3               22
236350          2010      4               3
SQL> With regular expressions would look something like this:
WITH T as
(SELECT  '53-2010-2-101' test_string FROM DUAL union all
SELECT  '2219-2010-3-22' FROM DUAL union all
SELECT  '236350-2010-4-3' FROM DUAL)
SELECT regexp_substr(test_string, '\d+', 1, 1) stu_id,
        regexp_substr(test_string, '\d+', 1, 2) fiscal_yr,
        regexp_substr(test_string, '\d+', 1, 3) sess,
        regexp_substr(test_string, '\d+', 1, 4) sch_id
   FROM t;Edited by: fsitja on Jan 28, 2010 6:07 PM

Similar Messages

  • Parsing Phone Numbers

    Hello,
    We are working on an integration that needs the phone numbers in CRMOD parsed out into the individual components. Currently the Web Services provide a phone number in it's full form. We would like to get the country code, area code, phone number, and extension as separate values. In CRMOD this is automatically done when you click on the "phone" icon. I'm not sure if CRMOD stores these values separately, or if this is just an algorithm. If it is an algorithm, has anyone re-created it?
    Thanks.
    Neal G.

    Check out the following template from metalink.
    Address Mapping Template and Phone Mapping Guide (Doc ID 556551.1)

  • Read CLOB and parse out records

    I have a table that features an XMLTYPE column containing CLOB data with XML and HTML content in it. I'm not quite sure how I can parse out the [CDATA] section and create a unique list of IDs contained within the javascript:openLink() string. Any ideas? I've tried searching the forums for how to read a CLOB and parse out each line, but didn't find the results I was looking for.
    I've provided a sample of some of the content in this column:
    <html><![CDATA[
    <P>
    <font face="Arial" SIZE="3">
    <strong>
    <span style="FONT-FAMILY: Arial">Recruiting</span>
    </strong>
    </font>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1010)">2008 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1009)">2007 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1008)">2006 Newsletters</A>
    </P>
    ]]></html>
    I basically need to output a list of IDs:
    LinkID
    1010
    1009
    1008

    Sorry...I thought I could figure things out based on your example, but I 'm not sure if 10g supports noentityescaping clause. Do you happen to know what I would need to substitute it with? To my understanding the XMLELEMENT function takes a name for "identifier," although I'm not quite sure in this case what the identifier should be...an XML tag value?
    This is SQL I tried to run but not getting any results:
    SELECT t2.*
    FROM (SELECT pagecontent
    FROM tb_rh_page
    WHERE pageid = 1) T,
    XMLTABLE('a/@href' PASSING XMLELEMENT(noentityescaping, EXTRACTVALUE(T.pagecontent,'/p_PAGECONTENT/Controls/divTopLeft/html/text()')).EXTRACT('//a')
    COLUMNS linkid integer PATH 'ora:replace(.,"[^[:digit:]]","")') t2
    Also the HTML is a little deeper in the XML than I originally posted, so I'm not sure if I'm getting to the path correctly.
    Here's what the data looks like in the column:
    <p_PAGECONTENT>
    <PageName/>
    <Title/>
    <Roles/>
    <Controls>
    <PageTool>
    <visible>false</visible>
    </PageTool>
    <divTopLeft>
    <visible>true</visible>
    <style>font-size:larger;overflow:auto;FILTER: progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#3b6f9f, EndColorStr=#e6eff6);Height:560px;background-color:#003366;border-bottom-width: 1px;border-color: #c6ddf1;border-left-width: 1px;border-right-width: 1px;border-style: Solid;border-top-width: 1px;</style>
    <html><![CDATA[
    <P>
    <font face="Arial" SIZE="3">
    <strong>
    <span style="FONT-FAMILY: Arial">Recruiting</span>
    </strong>
    </font>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1010)">2008 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1009)">2007 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(2008)">2006 Newsletters</A>
    </P>
    ]]></html>
    </divTopLeft>
    <divTopRight>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divTopRight>
    <divBottomLeft>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divBottomLeft>
    <divBottomRight>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divBottomRight>
    </Controls>
    </p_PAGECONTENT>

  • How to parse out primitives out of a stream?

    Hi there!
    I need to parse a lot primitives (chars, ints, longs, bytes) out of a stream.
    My Problem is, that the following way is very slow:
    BufferedReader.readline -> String.substring -> Integer.parseInt(String).
    This algoryth produces a lot of Garbage and most CPU-power is used to create new objects (Strings).
    To serilisize the wrapper-classes of primitives also isnt a solution, because it also produces much traffic and is slow.
    Does anybody know a Library which does allow to parse out a big amount of primitive Types very fast, like something which interacts with the stream directly. Could also be something which isnt included in the JDK...
    Thanks, Clemens
    lg Clemens

    if your input stream is created by ObjectOutputStream/DataOutputStream, then you can use ObjectInputStream/DataInputStream, otherwise, you will need to parse it yourself.

  • How to parse out curly quotes from a string

    Hi,
    I am writing a web application, where people will be copying from a Word Document into a text area. Then I get a String from the parameter passed.
    How can I parse out curly quotes and mdashes from this String? Are there specific character codes that I can parse out to replace them with regular quote characters or html quote characters?
    Thanks,
    Gabe

    Interesting problem and one that we had to deal with a couple of years ago. I think you might be talking about smart quotes and these are actually control characters used by MS products. They show up as squares in HTML unless properly dealt with. Try downloading some UNICODE charts to find out the values of these characters. I think they are something like 0044 and 0042 but I cannot remember off hand.

  • Parse out global channels

    I have cDAQ 9172. The users will enter different global channels and I want to parse out the digital channels and have them in a seperate array. The other channels should be in the same order as the user selects. I am reading in global channels that will always be in the same format but never in the same order. Example: 9401-DI-1:2 .... and 9205-VI-1:3 and 9237-PI-1:2 would end up in two tasks. The Analog In tasks will be 9205-VI-1:3, 9237-PI-1:2 and I would then have a different task for the Digital Input 9401-DI-1:2. The user should be able to enter tasks in any order.
    Solved!
    Go to Solution.
    Attachments:
    ParseGlobalChannels.vi ‏15 KB

    Well I solved this myself. Didn't see the Match Regular Expression Function. That allows the use of the or function and makes things a whole lot earier.
    Attachments:
    ParseGlobalChannels.vi ‏21 KB

  • Parsing out HTTP headers

    I'm writing a simple HTTP client and server. I'm looking for an efficent way to parse out the HTTP headers that the server sends. The code below is working for me at the moment but i don't think it's the correct way of going about it.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public final class RequestTEST {
        public static void main(String args[]) throws Exception
               final String CRLF ="\r\n";
               try {
                   Socket mySocket = new Socket ("127.0.0.1", 5306 );
                   DataOutputStream out = new DataOutputStream(mySocket.getOutputStream());
                   InputStream in = mySocket.getInputStream();
                   System.out.println("Enter a file name to request");
                   String filename = Console.readString();
                   String request = "GET /"+filename;
                   System.out.println("Sending "+request);
                   out.writeUTF( request );
                   int bytes = 0;
                   boolean header = true;
                   while((bytes = in.read()) != -1 && header)
                        if(bytes==10) //Line Feed LF
                             bytes = in.read();
                             if (bytes==13) //Carriage return CR
                             header=false;
                   System.out.println(bytes);
                   in = mySocket.getInputStream();
                   byte[] buffer = new byte[1024];
                   FileOutputStream oStream = new FileOutputStream(filename);
                   while((bytes = in.read(buffer)) != -1 )
                   System.out.println(bytes);
                oStream.write(buffer, 0, bytes);
                oStream.close();
                   mySocket.close ();
               catch (Exception exp ){
                   exp.printStackTrace();
    }I know the code is a little rough but i'm just developing the idea. Only started it today.
    Any suggestions or tips on the overall approach to this would be much appreciated.

    Maybe use the HttpURLConnection and then getHeaderFields().
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.HttpURLConnection;
    public class URLTester
         private final static String PROTOCOL = "http://";
         public static void main(String args[])
              if ( args.length != 1 )
                   System.out.println("Usage: java URLTester <url>");
                   System.exit(-1);
              String urlString = args[0];
              try
                   //  Create URL object from the URL string
                   URL url = new URL(PROTOCOL + urlString);
                   //  The connection object has information that may be
                   //  retrieved without parsing the data returned
                   HttpURLConnection conn = (HttpURLConnection)url.openConnection();
                   conn.connect();
                   //  Get an input stream from the URLConnection object
                   InputStreamReader isr = new InputStreamReader( conn.getInputStream() );
                   BufferedReader in = new BufferedReader( isr );
                   System.out.println( conn.getHeaderField(0) );
                   int headers = conn.getHeaderFields().size();
                   for (int i = 1; i < headers; i++)
                        System.out.println(conn.getHeaderFieldKey(i)
                             + " : " + conn.getHeaderField(i));
                   String line;
                   while ( (line = in.readLine() ) != null )
                        System.out.println( line );
                   in.close();
              catch(IOException e)
                   System.out.println( e );
    }

  • Spelling Out Numbers In Arabic

    Dears,
    I need a PL/SQl Procedure that spell out Numbers in Arabic(Tafkeet)
    any help is highly appreciated,
    please send Function code to :
    [email protected]
    with lots of thanks
    Regards

    See the following thread for an example in spanish
    Converting a number into world In spanish Language

  • XML PL/SQL Parser Out of memory

    Im parsing a 20M file and recieving the following result.
    I have tried to cut the file size down and have found a small
    version that will parse successfully.
    We have tried adjusting
    the ulimit -d 2097152
    ulimit -s 32768
    and also set java_pool_size = 41943040 in init.ora
    none of these seemed to be enough to enable parsing of the file.
    The following are 2 executions of the parser using 2 different
    file sizes.
    Thanks,
    Steve
    BEGIN
    domsample('/u01/app/oracle/xmlparser/samp','dan55.xml','errors.tx
    t'); END;
    ERROR at line 1:
    ORA-29554: unhandled Java out of memory condition
    BEGIN
    domsample('/u01/app/oracle/xmlparser/samp','dan60.xml','errors.tx
    t'); END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.OutOfMemoryError
    ORA-06512: at "PHASE2.XMLPARSERCOVER", line 0
    ORA-06512: at "PHASE2.XMLPARSER", line 118
    ORA-06512: at "PHASE2.DOMSAMPLE", line 84
    ORA-06512: at line 1
    null

    Steve (guest) wrote:
    : Oracle XML Team wrote:
    : : Steve Coffman (guest) wrote:
    : : : Im parsing a 20M file and recieving the following result.
    : : : I have tried to cut the file size down and have found a
    small
    : : : version that will parse successfully.
    : : : We have tried adjusting
    : : : the ulimit -d 2097152
    : : : ulimit -s 32768
    : : : and also set java_pool_size = 41943040 in init.ora
    : : : none of these seemed to be enough to enable parsing of the
    : : file.
    : : : The following are 2 executions of the parser using 2
    : different
    : : : file sizes.
    : : : Thanks,
    : : : Steve
    : : : BEGIN
    : : : domsample
    : : ('/u01/app/oracle/xmlparser/samp','dan55.xml','errors.tx
    : : : t'); END;
    : : : ERROR at line 1:
    : : : ORA-29554: unhandled Java out of memory condition
    : : : BEGIN
    : : : domsample
    : : ('/u01/app/oracle/xmlparser/samp','dan60.xml','errors.tx
    : : : t'); END;
    : : : ERROR at line 1:
    : : : ORA-29532: Java call terminated by uncaught Java exception:
    : : : java.lang.OutOfMemoryError
    : : : ORA-06512: at "PHASE2.XMLPARSERCOVER", line 0
    : : : ORA-06512: at "PHASE2.XMLPARSER", line 118
    : : : ORA-06512: at "PHASE2.DOMSAMPLE", line 84
    : : : ORA-06512: at line 1
    : : On what OS and with how much installed memory are you
    running?
    : : Oracle XML Team
    : : http://technet.oracle.com
    : : Oracle Technology Network
    : The server is a
    : Digital UNIX V4.0E (Rev. 1091)
    : with 2Gig Ram
    Oracle version 8.1.5
    null

  • Parsing long numbers as strings

    Hi
    Is there any way you can prevent a long number being converted to scientific notation? I have to write a method that substrs out each numeric character from a long positive whole number but when the number gets lon it falls over as the number is converted to scientific notation containing '.' and 'E' etc
    Any help would be appreciated
    Cheers

    Hi guys
    Thanks for the replies. I think the FM with 63 9s will probably be the simplest.
    I'm sorry I wasn't able to post an example as I was just heading out of the office for the day, but have got home so, for completeness will try to pen an example...although I don't have a server here so will be guessing syntax etc :-)
    Please forgive me if it doesn't run first time, but it should convey the intention...if necessary I'll debug it in the morning.
    Cheers
    declare
    mystring varchar2(1000) := '9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999';
    thisnum number;
    retnum number := 0;
    k number;
    begin
    k:=1;
    while k >0 loop
    for i in 1...length(mystring) loop
    thisnum != to_number(substr(mystring,i,1));
    retnum := retnum +thisnum;
    end loop;
    if length(retnum) > 60 then
    mystring := 'retnum';
    else
    k :=0;
    end if;
    end loop;
    --in the real case the retnum value would be stored at this point
    end;
    the 'while' loop if needed for very long strings where the 'addition' step hasn't decreased the length enough to be parsed as a number, the problem I have encountered only happens when the resulting number from the first run is long enough for an implicit conversion to scientific notation, this example may not be long enough to trigger it.

  • Need some help with figuring out numbers

    I downloaded the newest version of numbers on my computer and created a new document.  However, now it will not let me get in that document because it says I do not have the latest version of numbers.  I checked and I do have the latest update for the software.  Any suggestions??

    Hi Jim,
    I am trying to guess how you figured it out. For the benefit of other users, please tell. Perhaps this will help:
    Wayne Contello has written a User Tip for this problem in the new releases of iWork.
    https://discussions.apple.com/docs/DOC-6991
    The trick is to drag icons for both versions to your Dock. Right click or control click on each and Options > Keep in Dock. That puts you in charge of which version you launch.
    Instead of double clicking the document, run whichever version of Numbers suits and use File > Open.
    Regards,
    Ian.

  • Parse out the contents of meta tag using HTML.Tag

    I need help with using the HTML.Tag class. I don't even know where to start...
    I want to make a method that allows me to pass in a very long string and the NAME of the meta tag.. and will return the contents of the meta tag.. any help will be super..
    sorry i do not have much of a code base to start with.. I am just guessing on how to get this to work..
    private String getMetatag(String content,String Metaname)
    String Metacontents;
    Object HTML.Tag.META;
    Object HTML.Attribute.NAME.Metaname;
         Object HTML.Attribute.CONTENT;
    return Metacontents;
    }

    One of the way to get started is to check out how to overide (extend) the class
    HTMLEditorKit.ParserCallback.. Lets say the class is called class A
    Overide the methods for
    HandleSImpleTags( HTML.Tag t, AttributeSet attribute, int pos) { }
    roughly, the implemenation in that method is like this:
    HandleSImpleTags( HTML.Tag t, AttributeSet attribute, int pos) {
    if(t.equals(HTML.Tag.META) {
    /// your procedure, what to do when encounter META tag
    // String str = (String) attribute.getAttribute(HTML.Attribute.NAME);
    // System.out.println(str);
    You would still need to find some detail examples on how to use class A .
    Roughly it is,
    parser.parse(inputstream, an_instance of_class_A, true); // method in a outer class like a main class
    parser is a instatiation of from the method getParser. This method need to be overidden as well.

  • Listing out numbers in rows

    Hi people, i would like to list our numbers 1 to 100, 10 numbers per row. If a number has a 7 in it, it will show 2 asterisks. How could i go about doing it??? Sorry as i'm new to Java. I'd tried but only manged to get all the numbers appearing in 1 column. Thanks.
    public class SevenUp
         static boolean SevenUp(int num)
              if(num==100)
              return false;
              else
                   if(num>9)
                        if (num/10==7)
                        return true;
                        else if(num%10==7)
                        return true;
                        else
                        return false;
                   else
                        if(num==7)
                        return true;
                        else
                        return false;
        public static void main(String[]args)
              int num=1;
              for(int row=0; row<=10; row++)
                   for(int i=1; i<=10; i++)
                        num=i+(row*9);
                         if(SevenUp(num)==true)
                              System.out.println("**\t");
                         else
                              System.out.println(num+"\t");
    }

    Maybe your game isn't what I think it is, but we always played this as "if the number has a 7, or is divisible by 7, then say, 'Buzz'" [where Buzz would be the equivalent of your "**".  You can always modified your SevenUp to add more rules later.
    By the way, using a method named SevenUp in a class named SevenUp is a terrible idea.  Too confusing!  :)
    Besides, the convention is that methods should have names that start with a lowercase letter (e.g., "sevenUp").                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Parsing localized numbers

    I'm trying to use NumberFormat to validate a string containing a formatted number but having a lot of problems. First, invalid strings are just ignored (same thing as http://forum.java.sun.com/thread.jsp?forum=31&thread=157703)
    Also in French, space is used as thousands separators, however if I use a string with space only only the thousands are parsed, i.e.:
    String value = "1 234,45";
    try {
       Number number = NumberFormat.getNumberInstance(Locale.FRENCH).parse(value);
    System.out.println(number.floatValue());
    } catch (ParseException e) {
       e.printStackTrace();
    }The output:
    1.0
    Any help? Thanks!

    With the NumberFormat, you will get an exception only if the very first character is not parseable. But you don't have to write your own parse routine, just do this:
    import java.text.*;
    import java.util.*;
    public class number {
       public static void main(String[] args) {
          try {
             DecimalFormatSymbols df = new DecimalFormatSymbols(Locale.FRENCH);
             df.setDecimalSeparator(',');
             df.setGroupingSeparator(' ');
             DecimalFormat NF=new DecimalFormat("#,###.##",df);
             String out=NF.format(-1234.56);
             System.out.println(out);
             ParsePosition PP=new ParsePosition(0);
             Number number = NF.parse(args[0],PP);
             if (PP.getIndex()!=args[0].length()) System.out.println("Parse Exception");
             System.out.println(number);
          } catch (Throwable exception) {
             exception.printStackTrace();
    }V.V.

  • XML Question - Parse out node

    My program processes an xml data stored in CRM.
    The program extracts the XML data as a string. I need to be able to access the data contained within a particular node.
    The node <result> contains my data. I need to extract these values to do subsequent data table lookups.
    Any assistance in gaining access to the result node values is appreciated.
    An example of the file is shown below:
    <?xml version="1.0" encoding="utf-8"?>
    <survey xmlns:abapsurvey="http://www.sap.com/abapsurvey" xmlns:bee="http://www.sap.com/survey/bee" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:htmlb="http://www.sap.com/survey/htmlb" xmlns:out="http://www.w3.org/1999/XSL/Output" xmlns:svy="http://www.sap.com/survey/svy" xmlns:tmp="http://www.sap.com/survey/tmp" xmlns:values="http://www.w3.org/1999/XSL/TransformValues" xmlns:wff="http://www.mysap.com/wff/2001">
      <ratingfactor>
        <id_5067ea774ce37c4a998c56c296ef383e>0 </id_5067ea774ce37c4a998c56c296ef383e>
        <q1>1 </q1>
        <id_77cdd93138447b4b993442c2918b8bdb>0 </id_77cdd93138447b4b993442c2918b8bdb>
        <id_37721faa404c814d9bc265b4f19887f0>0 </id_37721faa404c814d9bc265b4f19887f0>
        <id_00ec9ccaf7f98542995c5b97261c90d1>0 </id_00ec9ccaf7f98542995c5b97261c90d1>
        <id_74592f01f5cc2440a87fedda3754db8e>0 </id_74592f01f5cc2440a87fedda3754db8e>
      </ratingfactor>
      <result>
        <id_5067ea774ce37c4a998c56c296ef383e>
          <id_3887d603f663d644a03b8212f3af24e7>id_eb6cae9b1688f84babeaae6c2aa53796</id_3887d603f663d644a03b8212f3af24e7>
        </id_5067ea774ce37c4a998c56c296ef383e>
        <q1>
          <a1>id_1f84102b913e3344a38cc166a9933452</a1>
        </q1>
        <id_77cdd93138447b4b993442c2918b8bdb>
          <id_275bf37ff1a68f4c88aaf7d4fa6cd4dc>id_a655b90477634640955428143e4a6f66</id_275bf37ff1a68f4c88aaf7d4fa6cd4dc>
        </id_77cdd93138447b4b993442c2918b8bdb>
        <id_37721faa404c814d9bc265b4f19887f0>
          <id_4915c8ad1dcf2740ac545d3ffd2a0af6>id_65d7c9277da37648b6600de52e2a095e</id_4915c8ad1dcf2740ac545d3ffd2a0af6>
        </id_37721faa404c814d9bc265b4f19887f0>
        <id_00ec9ccaf7f98542995c5b97261c90d1>
          <id_2ef55b647e558a4eba40e8f78d15818d>id_46aabd5305894649b9d28f15c0e439b7</id_2ef55b647e558a4eba40e8f78d15818d>
        </id_00ec9ccaf7f98542995c5b97261c90d1>
        <id_74592f01f5cc2440a87fedda3754db8e>
          <id_6182ead1dd8fe74abe9feccb316a86d3>This is my additional info for the customer.
        </id_74592f01f5cc2440a87fedda3754db8e>
      </result>
    </survey>

    I hope I understood you correctly.  This program finds the begining of <result> and the end of </result> and shows whats in the middle. 
    report zrich_0001 line-size 500.
    data: result_start type i.
    data: result_end   type i.
    data: offset type i.
    data: xml_string type string.
    xml_string = '<?xml version="1.0" encoding="utf-8"?><result>' &
                 '<id_5067ea774ce37c4a998c56c296ef383e>' &
                 '<id_6182ead1dd8fe74abe9feccb316a86d3>' &
                 'This is my additional info for the customer.' &
                 '</id_74592f01f5cc2440a87fedda3754db8e> ' &
                 '</result></survey>'.
    search xml_string for '<result>'.
    if sy-subrc  = 0.
      result_start = sy-fdpos.
    endif.
    search xml_string for '</result>'.
    if sy-subrc  = 0.
      result_end = sy-fdpos.
    endif.
    * the plus nine accounts for the "</result>"
    offset = ( result_end - result_start ) + 9.
    write:/ xml_string+result_start(offset).
    check sy-subrc  = 0.
    Regards,
    Rich Heilman

Maybe you are looking for