How to extract string with delimiter

Hello all,
I'm using Oracle 10g and want to extract string with a delimiter.
For example, i have aaaa;;bbbb;cccc;dddd;eeee;ffff and i want to extract this string into separates strings 'aaaa', ' ', 'bbbb', 'cccc', 'dddd', 'eeee', 'ffff'.
Thanks a lots for yours help.
MK.

I prefer the regular expression method myself...
SQL> ed
Wrote file afiedt.buf
  1  with t as (select 'aaaa;;bbbb;cccc;dddd;eeee;ffff' as txt from dual)
  2  -- end of sample data
  3  select REGEXP_SUBSTR (txt, '[^;]+', 1, level)
  4  from t
  5* connect by level <= (select length(regexp_replace(txt,'[^;]*'))+1 from t)
SQL> /
REGEXP_SUBSTR(TXT,'[^;]+',1,LE
aaaa
bbbb
cccc
dddd
eeee
ffff
7 rows selected.
SQL>

Similar Messages

  • Open Hub: How-to doc "How to Extract data with Open Hub to a Logical File"

    Hi all,
    We are using open hub to download transaction files from infocubes to application server, and would like to have filename which is dynamic based period and year, i.e. period and year of the transaction data to be downloaded. 
    I understand we could use logical file for this purpose.  However we are not sure how to have the period and year to be dynamically derived in filename.
    I have read in sdn a number of posted messages on a similar topic and many have suggested a 'How-to' paper titled "How to Extract data with Open Hub to a Logical Filename".  However i could not seem to be able to get document from the link given. 
    Just wonder if anyone has the correct or latest link to the document, or would appreciate if you could share the document with all in sdn if you have a copy.
    Many thanks and best regards,
    Victoria

    Hi,
    After creating open hub press F1 in Application server file name text box from the help window there u Click on Maintain 'Client independent file names and file paths'  then u will be taken to the Implementation guide screen > click on Cross client maintanance of file name > create a logical file path by clicking on new entiries > after creating logical file path now go to Logical file name definition there give your Logical file , name , physical file (ur file name followed by month or year what ever is applicable (press f1 for more info)) , data format (ASC) , application area (BW) and logical path (choose from F4 selection which u have created first), now goto Assignment of  physical path to logical path > give syntax group >physical path is the path u gave at logical file name definition.
    however we have created a logical path file name to identify the file by sys date but ur requirement seems to be of dynamic date of tranaction data...may u can achieve this by creating a variable. U can see the help from F1 that would be of much help to u. All the above steps i have explained will help u create a dynamic logical file.
    hope this helps u to some extent.
    Regards

  • How to display string with XML content in 4.6?

    Hi,
    I`d like to know how to display string with XML content in it for 4.6.
    4.6 has not method parse_string.
    And example like this is not helpful:
      DATA: lo_mxml    TYPE REF TO cl_xml_document.
      CREATE OBJECT lo_mxml.
      CALL METHOD lo_mxml->parse_string
        EXPORTING
          stream = gv_xml_string.
      CALL METHOD lo_mxml->display.
    Thank you.

    Hi,
    May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.

  • How to concatenate string with a numeric control ?

    Hi,
    How to concatenate string with a numeric control ?
    Thankyou.
    Solved!
    Go to Solution.

    Its simpler to just use the Format Into String.
    Attachments:
    Format Into String.png ‏11 KB

  • How to write strings with an underline on the TOP-OF-PAGE of ALV

    How to write strings with an underline on the TOP-OF-PAGE of ALV

    if u r using classes and methods it can be done
    but if u r using normal fms and then u have to use HTML_TOP_OF_PAGE but the drawback for this it cannot be printed when the report is printed .

  • How to Search strings with and without quotes

    Hello,
    I need to search a string with quote and without quote the same way
    Ex: Wendy's
    If user enters wendys without ' also need to return all the Wendy's..!
    I appreciate any help...!
    Thanks
    RG

    Hi,
    RG wrote:
    Hello,
    I need to search a string with quote and without quote the same way
    Ex: Wendy's
    If user enters wendys without ' also need to return all the Wendy's..!
    I appreciate any help...!So you want to ignore single-quotes, is that it?
    Here's one way:
    INSTR ( REPLACE (big_string,       '''')
          , REPLACE (substring_sought, '''')
          )  > 0 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • How to put String with html tags as it is into xml

    I am using apache dom API to create xml from java.
    I have a string with html tags in it .when I add the string to xml, its replacing all the "<"; with &lt and ">" with > I would like the html tags to look as it is instead of the > and & lt;. How can I acheive that
    this is the code snippet of what I am doing
    In java class
    String titleString = "<font color=red>This Is an Example of a Red Subject</font>"
    Document doc = new DocumentImpl();
    Element root = doc.createElement("bulletin");
    Element item = doc.createElement("title");
    item.appendChild(doc.createTextNode(titleString));
    In Xml it looks like below
    <title><font color=red>This Is an Example of a Red Subject</font></title>
    but I would like to have the xml like below
    <title><font color="red">This Is an Example of a Red Subject</font></title>
    Can you please suggest me whats the best way to acheive this.
    I appreciate all your help
    Thank you
    Suma

    One problem is that you don't understand escaping. If you re-read what you posted you'll see that what you say you get, and what you say you want, are identical. That's because you didn't escape one of the two properly. So your first step should be to find the section about escaping in Chapter 1 of your XML book and read it carefully. Figure out what you should have done here (yes, the same rules apply).
    However, to attempt to answer what I think your question is: if you have a String which contains markup, and you want to convert that String to XML elements, then you have to feed the String into an XML parser.

  • How to export strings with "\"

    When I export a string with backslashes in it (eg. path name to a file) then when this file is imported at run time then backslashes '\' cause the import to fail. So for now I have to replace all "xxx\yyy" strings in exported file with "xxx\\yyy" and then import
    of such MODIFIED file goes OK.
    But this is tedious - is there another way to deal with it ?

    This is caused by the fact that the ASCII backslash character is the escape code specifier, and when the file is read by the import/export properties tool it is treated as such. If you have any character sequences in a string such as "\t" or "\n" these get interpreted as tabs and newlines within the string.
    To avoid this behavior when importing you will need to modify the strings in TestStand before exporting them to include the "\\" escape code set to the file. The caveat to this is once these values are read back from the file they will be interpreted as single backslashes. For instance, if you export "c:\\temp", and then import it back you will get "c:\temp". This is simply the nature of the Import/Export Properties tool.
    If you do not like the b
    ehavior of this tool in its shipping form, you can rebuild the "limitloader.dll" module to include the functionality that you want. Whenever you click the Tools>>Import/Export Properties menu selection, the MainSequence of \Components\NI\Tools\ImportExport.seq is being executed. This has a single step in it that calls the "DisplayImportExportDialog" function of the limitloader.dll. The source for the limitloader.dll can be found in the \Components\NI\StepTypes\Database directory.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • How to convert column with delimited string into rows

    I have a string value in a single column, delimited by colon. The number of items in the string is variable. I need to select the data from this column into separate rows based on the delimiter. I can write a function with a loop but if there is a way to do this in SQL it would be better.
    Table contains a column with data value:
    12:130:1400
    And I want to select data and return as:
    12
    130
    1400
    This in in Oracle 9i.
    Please don't post "look for pivot or transpose in the forum" as that is not a helpful answer (I have already done that).
    Thanks!
    Message was edited by:
    splinternet

    SQL> create table mytable (id,value)
      2  as
      3  select 1, '12:130:1400' from dual union all
      4  select 2, '483' from dual union all
      5  select 3, '1:2:3:4:5:6:77:888' from dual union all
      6  select 4, null from dual
      7  /
    Tabel is aangemaakt.
    SQL> select id
      2       , trim(':' from v) value
      3       , substr
      4         ( v
      5         , instr(v,':',1,t.column_value) + 1
      6         , instr(v,':',1,1 + t.column_value)
      7           - instr(v,':',1,t.column_value) - 1
      8         ) part
      9    from ( select id, ':' || value || ':' v from mytable ) m
    10       , table
    11         ( cast
    12           ( multiset
    13             ( select level l
    14                 from dual
    15              connect by rownum <= length(m.v) - length(replace(m.v,':')) - 1
    16             )
    17           as sys.dbms_debug_vc2coll
    18           )
    19         ) t
    20   order by m.id
    21       , t.column_value
    22  /
            ID VALUE                PART
             1 12:130:1400          12
             1 12:130:1400          130
             1 12:130:1400          1400
             2 483                  483
             3 1:2:3:4:5:6:77:888   1
             3 1:2:3:4:5:6:77:888   2
             3 1:2:3:4:5:6:77:888   3
             3 1:2:3:4:5:6:77:888   4
             3 1:2:3:4:5:6:77:888   5
             3 1:2:3:4:5:6:77:888   6
             3 1:2:3:4:5:6:77:888   77
             3 1:2:3:4:5:6:77:888   888
             4
    13 rijen zijn geselecteerd.Regards,
    Rob.

  • How to extract a tab delimiter file on appli server in openhub destination

    Hi All,
    in my scenario i want download a file on application server in tab delimiter file where iam not able to do it.while creating  OHD iam selecting seperator feild has ';'(semicolan).tab delimiter fule format is not posible with semicolan and even i tried it with "comma" also but not getting the tab delimiter formate.please help how to get that particular format..
    thanks
    vamshi..

    Hi Dashyam,
    May help you:----
    with comma delimiter file read
    I want to download comma delimiter file on to presentation server from inte
    http://wiki.sdn.sap.com/wiki/display/ABAP/UploadaCommaDelimitedCSVfilethatcontainscommasindata+fields
    Regards,
    Suman

  • How to extract file with the extension .CAR

    Hi,
    I have a requirement where I need to extract the file .CAR . I have tried with the following command in DOS prompt :-  CAR -xvf <filename>  but I am not able to extract the file.Can you please tell how can I extract this file.What do I need to install to extract it?
    Regards,
    Pawan

    Hi,
    Check these links
    http://www.easymarketplace.de/winzip-7zip.php?Area=4soi
    http://service.sap.com/patches (SMP id required)
    Regards
    Fahad hamsa

  • How to replace string with image( Say Smiley).........????

    Hello To All Experts !!
    I wanna looking for some help in displaying image in my text area when should i type ":)" in text field.....
    I got some program through forums....
    import java.util.*;
    import javax.swing.ImageIcon;
    public class TokenizeSmiley {
        private static final HashMap SMILEYS;
        static {
            SMILEYS = new HashMap();
            SMILEYS.put(":)", new ImageIcon("images/1.gif"));
            SMILEYS.put(";)", "<wink>");
        public static void main(String[] args) {
            String text = "Hello!! :) How are you ;)";
            StringTokenizer st = new StringTokenizer(text);
            String token;
            while (st.hasMoreTokens()) {
                token = st.nextToken();
                if (SMILEYS.containsKey(token))
                    token = (String)SMILEYS.get(token);
                System.out.print(token + " ");
    }but it is showing <smile> and <wink> as it is given...i tried to give path of image ...but it is nt fetching then also.....
    Plz help in this....
    Message was edited by:
    Damz@del

    So your data is stored in XML. So what? You haven't asked a question about the XML or how to format it or how to access it. You asked a question that had nothing to do with XML at all. It's as if you said "My data is stored on a Windows computer so I will call Microsoft's support line to ask them this question."
    And I can't even suggest a suitable forum because a "text area" could be an AWT component or an HTML component. But I do suggest you ask in the right place.

  • Scan from string and extract string between delimiter

    Hello,
    Basic questions.  Is it possible with the scan from string regular expression to extract the string that are within the specified delimiters.  Here is an example:
    \\Name of folder 1\Name of folder 2\Name of folder 3\File Name
    Can the scan from string output the following by specifying the right regular expression:
    Name of folder 1
    Name of folder 2
    Name of folder 3
    File Name
    I have tried \\\\%s\\%s\\%s\\%s but the %s stops at the first white space.
    Thanks,
    Michel
    Solved!
    Go to Solution.

    RavensFan suggested the appropriate function for your requirement, however you can also use an alternative, which is 'Spreadsheet String To Array'.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • How to replace string with image( Say Emoticons )??

    Hello Friends !!
    I am working on chat messenger and want some help in "How to access Emoticons when somebody typed :), ;), :)) and many more strings.....?"
    Is there any sample code to do that job or any function to perform such task??
    Thanks in Advance....

    use event listener... found match, load image instead of text on the fly.

  • How to find string with trailing space

    Hi,
    I need to search a word instead of string from another string.
    I tried below code and expected that FIND will not search 'weeds' but it seems FIND ignores trailing spaces of string zstr and thus finds word 'weeds'.
    DATA: zstr type string value 'we ',
              lv_string type string value 'These are weeds',
              result_tab TYPE match_result_tab.
    FIND FIRST OCCURRENCE OF regex zstr IN lv_string
                          IGNORING CASE
                          RESULTS result_tab.
    Please consider that zstr is runtime variable with no fixed length.
    If anybody has the solution, reply back fast !
    Regards,
    Sourabh

    Hi,
    Hi,
      DATA STRING(30) VALUE 'This is a little sentence.'.
    WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
    ULINE /1(26).
    SEARCH STRING FOR 'X'.
    WRITE: / 'X', SY-SUBRC UNDER 'SY-SUBRC',
                   SY-FDPOS UNDER 'SY-FDPOS'
    SEARCH STRING FOR 'itt '.
    WRITE: / 'itt   ', SY-SUBRC UNDER 'SY-SUBRC',
                       SY-FDPOS UNDER 'SY-FDPOS'
    SEARCH STRING FOR '.e .'.
    WRITE: / '.e .', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SEARCH STRING FOR '*e'.
    WRITE: / '*e ', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SEARCH STRING FOR 's*'.
    WRITE: / 's* ', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    Hope it will solve your problem..
    Pls. reward if useful...

Maybe you are looking for

  • Mac Pro won't boot up unless in Safe Mode

    When I try to boot my Mac Pro the fans start revolving very quickly and it loads to the spinning wheel/apple logo screen. I can get it to start up in Safe Mode, and 9 times out of 10 if I restart the computer from Safe Mode I can get everything to lo

  • Making a color transparent in many layers

    I'm using Photoshop Elements 5.0 I want to create an animated gif using many layers of jpegs. Each layer is a picture of the earth (round) surrounded by the color black to the edge of the jpeg (square). However, I would like to make the outer border

  • My RSS feed text not visible on mobile phones

    My site is working great (http://www.acconstant.com), but my friend and I are having trouble seeing the content on mobile phones (well, at least his and mine). Wondering if this is fix-able.

  • "quick Look Helper (32bit)" java se6 runtime

    hi everyone, i have just upgraded to Mountain Lion, everything is working as it was before, EXCEPT when i visit the Apple Store i keep getting this window pop up, i dont understand what it is all about, but so far i have always declined to Install it

  • My HD crashed on the computer I was syncing to- Can I copy photos

    My HD crashed on the computer I was syncing to- Can I copy photos OFF my Apple TV? There is a possiblity that some may not have been backed up anywhere else. Thanks, Mitch