Replace multiple whitespaces in a string with single one

Hi,
I'm using Oracle 9.2.0 and I have a query on string manipulation.
Can I replace multiple whitespaces within a string with single one. I tried with regexp_replace function but it is not supporting Oracle 9i.
Can someone help me out?
Regards,
Pramod

Just playing around:
WITH
     Strings
AS
      SELECT 'Can  I   replace      multiple  whitespaces   within    a     string    with single one' Text FROM Dual
SELECT
     REPLACE
      REPLACE
       XMLAGG
        XMLElement
         "A",
         SubStr(Text, Level, 1)
       '</A>'
      '<A>'
     ) Text
FROM
     Strings
WHERE
     NOT
          Level > 1
      AND     SubStr(Text, Level, 1)          = ' '
      AND     SubStr(Text, Level - 1, 1)     = ' '
CONNECT BY
     Level <= LENGTH(Text);

Similar Messages

  • Can we create multiple billing document from delivery with single line item

    can we create multiple billing document from delivery with single line item

    Hi
    Please check the link
    [can v create multiple billing document from delivery with single line item]
    and as Lakshmi said, check the forum before posting an issue.
    Regards
    AA

  • Can v create multiple billing document from delivery with single line item

    can v create multiple billing document from delivery with single line item

    Dear Sandesh
    Go to VOV7, select your item category.  In this maintain K  for Billing Relevance
    Now go to VF01, give the delivery number and do not press Enter.  Instead click on Selection list on the next screen, select the items you want to bill and click copy and continue if necessary
    thanks
    G. Lakshmipathi

  • How to replace a character in a string with blank space.

    Hi,
    How to replace a character in a string with blank space.
    Note:
    I have to change string  CL_DS_1===========CM01 to CL_DS_1               CM01.
    i.e) I have to replace '=' with ' '.
    I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp_fill_string WITH ' '</b>
    Its not working.

    Hi,
    Try with this..
    call method textedit- >replace_all
      exporting
        case_sensitive_mode = case_sensitive_mode
        replace_string = replace_string
        search_string = search_string
        whole_word_mode = whole_word_mode
      changing
        counter = counter
      exceptions
        error_cntl_call_method = 1
        invalid_parameter = 2.
    <b>Parameters</b>      <b> Description</b>    <b> Possible values</b>
    case_sensitive_mode    Upper-/lowercase       false Do not observe (default value)
                                                                       true  Observe
    replace_string                Text to replace the 
                                         occurrences of
                                         SEARCH_STRING
    search_string                 Text to be replaced
    whole_word_mode          Only replace whole words   false Find whole words and                                                                               
    parts of words (default                                                                               
    value)
                                                                               true  Only find whole words
    counter                         Return value specifying how
                                        many times the search string
                                        was replaced
    Regards,
      Jayaram...

  • How to concatenate a string with single quotes

    Hi all,
        how to concatenate a string with single quotes to a variable.
    Sathya

    Hi sathyabama,
    1. simple
    2. use TILDE character <b>(`)</b>
       (just left to the '1' key)
    <b> `'mystring'`</b>
    3. just copy paste
    report abc.
    data : m(100) type c.
    concatenate `'amit mittal'` 'hello' into m separated  by space.
    write m.
    regards,
    amit m.

  • Replacing a part of a String with a new String

    Hi everybody,
    is there a option or a method to replace a part of a String with a String???
    I only found the method "replace", but with this method I only can replace a char of the String. I don't need to replace only a char of a String, I have to replace a part of a String.
    e.g.:
    String str = "Hello you nice world!";
    str.replace("nice","wonderfull");   // this won't work, because I can't replace a String with the method "replace"
                                        // with this method I'm only able to replace charsDoes anyone know some method like I need???
    Thanks for your time on answering my question!!
    king regards
    IceCube-D

    do check java 1.4 api, I think there is a method in it, however for jdk1.3 you can use
    private static String replace(String str, String word,String word2) {
         if(str==null || word==null || word2 == null ||
               word.equals("") || word2.equals("") || str.equals("")) {
              return str;
         StringBuffer buff = new StringBuffer(str);
         int lastPosition = 0;
         while(lastPosition>-1) {
              int startIndex = str.indexOf(word,lastPosition);
              if(startIndex==-1) {
                   break;
              int len = word.length();
              buff.delete(startIndex,startIndex+len);
              char[] charArray = word2.toCharArray();
              buff.insert(startIndex,charArray);
              str = buff.toString();
              int len2 = startIndex+word2.length();
              lastPosition = str.indexOf(word,len2);
         return buff.toString();

  • Replacing old iTunes library on desktop with newer one from Laptop?

    I have two libraries. My original's on a desktop that was linked to an iPhone 3s. When I got a 4s, I setup a new one on a laptop because my desktop was not available for several months.  So, I setup new library with 4s and have it configured the way I want it.  Is there a way to replace the old library on desktop with the one from the laptop?
    Sorry if this has been asked before, but I couldn't find my exact problem.

    Move the entire library to the desktop, launch iTunes with the Shift key held down, and point it to that library. If the library contains rented movies, they won't play on the desktop.
    (101838)

  • Replace both Raid 1 hard drives with larger ones.

    This computer came set up for Raid 1.  I need to replace both hard drives with larger ones.  What is the proceedure for doing this?

    Hi wweksjk!: Yes you can have 2 HD's with differing capacities as an example on my Xion-MSI PC which was custom built in 2006 I had 2 Western Digital HD's, respectively 160 GB & 250GB divided into 3 partitions
    the brand name isn't as important as the rpm the faster the drive spins your computer will be faster
    also look at the size of the buffer on the drive as well because the higher the number there will speed up the boot time as well
    however installing a new drive as the boot drive will be complex but if you follow instructions that come with the HD installation software it can be done
    for example a 7200rpm drive is faster than a 5400rpm but not as fast as either a 10k or 15k model
    good luck
    hope this helps & enlightens you
    Happy Holidays!
                                                                                                                                    spacechild

  • Replace multiple characters in a string

    Hi, I have some string fields that contain special characters such as ô and û and I want to replace them with ō and ū, and their upper case equivalents as well. How do I write a single formula that would find any of these characters in a string and replace them?
    Thanks,
    Will

    replace(replace(replace(replace(x,'ô','ō'),'û','ū'),'Ô','Ö'),'Û','Ü');
    where x is the string field.  I suggest using the unicodes rather than the actual character.  I do not think that I have the correct uppercase characters.  Please ensure that they are correct in your formula.

  • Replace hex character in a string with another hex character

    Hi Guys,
    Heres a problem scenario, hex character 92 looks very much like hex character 27 (apostrophe).
    I need to write a program that can replace all hex character 92 to hex 27 in a string.
    Being a novice on the regular expressions, I would appreciate if somebody can show
    the exact syntax to to perform this replacement.
    Many Thanks
    -Anil

    I don't think you need to use regex to do this:
    String s = something();
    char a = 0x27;
    char b = 0x92;
    s.replace(a,b);
    And don't forget that since Strings are immutable you need:
    s = s.replace(a,b);to do anything useful.

  • How to handle XML string with Single Quotes as a parameter to SP dynamically?

    Hi,
    I would like to know if there is a way to handle the Single Quotes in XML value when it is passed to Stored Procedure?
    I should be able to handle it without adding another Single Quote to it.
    Thanks,
    Chandra Shekar

    Hi Chandra,
    Your requirement is not precise. Based on my understanding and guessing, are you metioning something like the below sample?
    /*If the xml is generated you have no need to escape the singe quote(')*/
    DECLARE @xmlTbl TABLE (ID INT,name VARCHAR(99));
    INSERT INTO @xmlTbl VALUES(1,'Eric''s')
    INSERT INTO @xmlTbl VALUES(2,'Zhang''s')
    DECLARE @xmlDoc1 XML
    SELECT @xmlDoc1
    FROM @xmlTbl FOR XML PATH('PERSON'),ROOT('PERSONS')
    EXEC yourProcedure @xmlDoc1
    /*If your copy and paste the xml, you have to escape the single quote(') with 2s('')*/
    DECLARE @xmlDoc2 XML
    SET @xmlDoc2 = '<PERSONS>
    <PERSON>
    <ID>1</ID>
    <name>Eric''s</name>
    </PERSON>
    <PERSON>
    <ID>2</ID>
    <name>Zhang''s</name>
    </PERSON>
    </PERSONS>'
    EXEC yourProcedure @xmlDoc2
    If that is not regarding your requirement, please elaborate with more details.
    Eric Zhang
    TechNet Community Support

  • Downloading multiple files from a site with single request?

    Interesting Scenario:
    User clicks on check boxes indicating which files they want to download from a site, then clicks a "Download" button. Is there a way (other than ZIPPING them) to download each file individually to the directory they specify?
    We have a reason for wanting individual files, instead of one lumped ZIP.
    We use Java for our appserver and JSPs for our pages.

    User clicks on check boxes indicating which files
    they want to download from a site, then clicks a
    "Download" button. Is there a way (other than
    ZIPPING them) to download each file individually to
    the directory they specify?I would think the answer is "no", since HTTP is request, response (1 response) and don't know how you'd get that one response to be "here are 2 files for the user to save to one directory".

  • How can I replace my Mac and iCloud contacts with the ones in my iPhone?

    I have a new iPhone (iOS 6) and have edited, added, linked and deleted some of my contacts. How can I have THAT list replace all of the other contact lists in the rest of my devices?

    If you are using iCloud on iPhone and Mac, that must be already done. If not, you have to setup iCloud on both devices with the same Apple ID.
    Before you try anything, download an app like "Contacts kit" or "My Contacts Backup" to your iPhone and make a backup of your list and send it via email to yourself.

  • How to check string array elements with a string with in one forEach tag ?

    Hi All,
    I am new to JSTL and EL. I need to change the following Java code into JSTL and EL.. I struggled to change this code into JSTL.
    How can i change the if loop which tests the string array element with one bean property ?
    -------------------------------------------------------------------------------------------------------------for(int j=0 ; j < iSelectedCount; j++)
    if(strSelectedRoleId[j].equals(lineRole.getRoleID()))
    isAvailable = true;
    Please help me on this.
    It is very urgent......
    Thank you for ur help,
    Natraj

    import java.util.Calendar;
    Calendar rightNow = Calendar.getInstance();  // gets the current date and time to millisec
    Calendar earlyTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 6).set(Calendar.MINUTE, 30);
    Calendar lateTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 8).set(Calendar.MINUTE, 0);
    if (rightNow.compareTo(earlyTime)> 0 && rightNow.compareTo(lateTime) < 0){
    // do something
    }Try this.

  • Tab bar is ~6px bigger with multiple tabs than it is with only one tab

    Example:
    I open a new FF window. One tab is open.
    I open a second tab. The tab bar now gains approx. 6 pixels in height. It shrinks back if I reduce the number of tabs I have open to 1.
    This is annoying. Is there anything that can be done about it?
    I've already tried fiddling with userChrome.css based on a Google search, but since I don't know what I'm doing I haven't had any luck in stopping this from happening.

    The close-button is present even if only one tab is open thanks to the "Last tab close button" addon which I have installed.
    Speaking of add-ons... I found out the problem disappears if I disable the Oxygen KDE add-on I have installed (probably should have tried disabling all add-ons first.... sorry!). However, the issue may still stand: I noticed that even without add-ons, if I close the last tab (with your setting in place), the FF tab bar shrinks by those same 6px.
    So I think what I'm needing is a way to make a tab bar with 0 open tabs the same height as a tab bar with 1+ open tab. I'm fairly confident that such a setting would automatically resolve the problem I turn out to be having with the Oxygen KDE add-on as well.
    Either way, it's probably best to take this issue up with the Oxygen KDE devs - correct? I'm terribly sorry if I've wasted your time.

Maybe you are looking for