Substitute the inconsistent spacing with a single space in a string

is it possible to replace multiple spaces in a string with a space only. Number of places is different all the time.

say a field contains strings with spaces
I need to replace all those values so that there will be only one space between words.

For example.
Input                             Expected Result
aaa    bbb                       aaa bbb
ww                vv             ww vv
ww ss      kk                    ww ss kk

[/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

user11253970 wrote:
I'm in Oracle 9i :( I can't use reg exp

Assuming that the strings contain no CHR (0) (character with ascii code 0):

SQL> SELECT  'aaa          bbb  aaa bbb' str,
  2          replace(replace(replace('aaa          bbb  aaa bbb',' ',' ' || CHR(0)),CHR(0) || ' '),CHR(0)) new_str
  3    FROM  dual
  4  /

STR                                 NEW_STR
----------------------------------- -----------------------------------
aaa          bbb  aaa bbb           aaa bbb aaa bbb

SQL> 

SY.

Tags: Database

Similar Questions

  • Search in Windows 8 is the jump for the home screen with a single typed character.

    As soon as I type anything in the search box, Windows 8 jumps to my home screen.  This completely prevents the search function.  Any suggestions for a solution would be much appreciated.

    blinks always directly to the start page without performing the search

    So, it doesn't look like a problem with the entry.
    Research work anywhere else?   For example Win - E, Ctrl-e

    There is a convenience store called the search and indexing, you can try.   Ironically, it would be useful to have search working to find, but you can navigate to it knowing it's there.

  • Measure the voltage and the temperature at the same time with a single card PCI 6014 DAQ?

    Hello guys,.

    I'm doing a charger measuring the voltage of the battery, the charge current and the temperature of the battery using a 6014 cardboard...

    I want to use my PCI6014 DAQ card to measure 2-channel analog voltage input and 1 temperature Channel Analog input using thermocouple type k measurement of voltage or temperature isolation is OK, but I can't understand how to measure the voltage and the temperature at the same time... I want to use input differential...

    Thank you in advance, all the tips

    YSL

    Create a task and add channels to the task, as follows:

    Christian

  • Rename the files & folders with a single command?

    I would like to rename a file folder and all the files & documents it contains.  The name is xxNAMExx I want to replace the part of middle NAME.  How can I do?

    Download the 32-bit version or 64-bit Bulk Rename, here http://www.bulkrenameutility.co.uk/Main_Intro.php

  • Can adjust the audio levels with a single clip

    Very simple question that drives me crazy.  Just before I post, I'm a complete to this noob please go easy on me.

    I'm editing a podcast.  It is a clip, a track in first pro.  My sound levels varies between-3 and - 12db through recording due to parts where I speak louder and quieter.   I need to balance a little better, to make the quiet parts louder.

    I don't know how to do this outside the insertion of keyframes volume level in the clip, which is slow and manual and takes forever.

    Every search I do to normalize levels is all about several clips and by adjusting the maximum peak in the same, that will not help me.

    Thanks in advance!

    Adobe Audition is a speech Volume Leveler you might want to check.

  • Can I use Lightroom on my mac and my pc at the same time with a single subscription?

    Hi all

    for five months now, I have a subscription to creative cloud for Lightroom and Photoshop. So far, I used just on my PC. Now I have bought me a MAC and want to install Lightroom on MAC either. Do I need a second subscription for MAC or can I use my subscription on MAC and PC at the same time?

    thx for your comments

    If you ask if you can run the software subscription on both machines at the same time, the answer is no.  Your license you can only use one of the facilities at any given time.

    If you ask that if you have the software installed and that can be used on both machines so the answer is Yes... just can not both machines in use, software subscription running at the same time.

  • Monthly subscription of Cloud first PR open CS6 and CC at the same time with a single subscription?

    I have download CS6 and CC version.

    I have a subscription monthly Premier Pro, but open just a CC and not a CS6 version

    WHY?

    Do I need a second subscription for the same program?

    your subscription to a cc allows you to install and use current and past (back to cs6) versions

  • On the list field with amount of placement matches query strings

    Hello!

    I have a property on produt is a list of string, it is called keywords, short product.keywords. I would like to query items that have similar, ordered keywords with the highest number of matches.

    For example:

    Product 1: key1, key2, key3

    Product 2: key1, key4

    Product 3: key1, key2, key5

    A query for "Product 1" similar goods would, in that order.

    Produces 1 (exact match)

    Product 3 (as associated with the keywords, key1 and key2 2)

    Product 2 (because it is matching 1 single keyword, key 1)

    I am able to return items, but not ordered, with this query:

    NTK = Product.Keywords

    NTT = "key1" | "' key2 ' | "" Key3 ".

    NTX = mode + matchallpartial

    How can I use classification for this request?

    Thank you.

    you will need to reproduce the Ntk matching property names to the many values of Ntt. In your URL, try two Ntk like Ntk = product.keywords | product.keywords

    http://localhost:8006/endeca_jspref/controller.jsp?N=0&eneHost=localhost&enePort=20000&SID=144F54DBCA77&N=0&NTK=product.keywords|product.keywords&NTT=Deus|Inferno&NTX=mode+matchallpartial+rel+freq

    You've got a friend difficult.  Looks like that the OER in search mode flags are applied to the names of properties of Ntt in order. To only one case is provided.

  • WORDPAD: HOW TO DEFINE MODEL DEFAULTS TO SINGLE SPACE?

    My computer came with Wordpad.  The model 'by default' seems to be set to double space and I don't know how to change it so that the default value is a single space (ie. like my ad here). Itdoesn't seem to be a 'box' in the menu at the top of the page - on the same line as the font settings/size - titled ' line spacing: change the spacingbetween of text lines ") but it doesn't seem to work ! Or, at least, I don't know how to operate it. I tried to play with the settings made here, but nothing that I don't seem to make any difference.

    In the line spacing box, you should be able to select; 1.0, 1.15, 1.5 or 2.0

  • MS Calculator written (shows) two or more numbers with a single entry

    Standard MS Calculator written (poster) two or more numbers at the same time with a single entry, as does not work properly when checking any box, (Eg. checking a box in Gmail to simply delete the message) it takes several times before it happens it's good.  I tried to adjust the parameters of 'mouse' and this does not help at all.  I am at a loss at this point, help?

    Windows 7 Home Premium OS Service Pack 1
    ASUS computer desktop CM6870 series
    Processor: Intel i7-3770CPU @ 3.4 GHz
    RAM: 16.0 GB
    System type: 64-bit OS

    Thanks for your suggestion, but it didn't work.  It is corrected now that I replaced the mouse with a new material and used the software installed, it works perfectly now.

  • Multiple tasks with a single click

    My job is to manually change several lines to a different graphic style and before this line to another layer.  As it is now, I change the graphic styles, choosing Select < even < fill & stroke and before moving the lines to the appropriate layer.  I am wanting to know if there is a way to change the graphic style and move the line to the other layer with a single click.  I'm ignorant when it comes to scripts, but I was wondering if there are scripts that would be subject to this function.

    You must explain in detail the installation program. Otherwise, the people making suggestions are just guessing. Here is my suggestion based on what little information you have provided:

    You don't need a script for this. You can do it with a set of very simple Actions. Example:

    Suppose that your recurring task requires three layers, named Red, green and blue. On each layer, all objects need to have the same graphic Style applied.

    1. new document. Create three layers. Name them, red, green and blue.

    2 define three graphic Styles. Name them, red, green and blue.

    3. draw an object (any object, a square, a line, no matter). Send it to the red channel. In the attributes Palette, type 'Red' in the Note field. (This effectively 'names' the 'Red' object.)

    4 draw an object, send it to the green channel. Type 'Green' in his Note.

    5 draw an object. Send it to the blue layer. In its Note of type 'blue '.

    6 draw an object on the Red layer. Select it.

    7 actions Palette: new Action. Name of the Action 'red '. Define red colour. Start recording:

    7.1 Edition > cut

    7.2 Edition > paste in front

    7.3 apply red graphic Style

    7.4 stop recording.

    Range of actions 8: select the stage of the Cup. In the menu drop-down select Select an object... In the dialog box, enter "red". OK, the dialog box. The Action should have now a new stage set the selection listed after the stage of the Cup.

    9 flyout Palette menu actions: the Mode button.

    You now have a red named Action which appears as a red button in the actions palette. Select an object. Click on the button. The object is moved to the Red layer and becomes red graphic style.

    10 turn off the Mode button. Duplicate Action. Double-click the duplicate. Change its name to green and its green color. Change its step set the selection to select the object named green. Replace its step of graphic Style with a stage that applies the Green graphic Style.

    11. Similarly, duplicate and edit one of the two Actions to create a blue Action. Put the actions in button Mode palette.

    Now you can select any number of items and then move them to the red, green or blue layer and apply the graphic Style suitable in one click.

    Now come back and reveal the specifics of your situation that makes all this work moot.

    JET

  • Insert two tables with a single query (same ID)

    Hello

    I want to insert two tables at the same time (with a single request) provided that both records get inserted with the same identifier. How can I do this?
    Table Movies
    id 
    name
    
    Table Category
    movie_id
    cat_type
    (a) insert in the first table, retrieve the id (can be using
    my_sequence.currval
    and then insert into another table.

    question: He brings three queries to the Database, I also suspect that when several people trying to insert there is a problem, I could be wrong.

    I have no other idea.

    Greatly appreciated!

    think you need to do as an anonymous pl/sql block.

    Dim cn As New OracleConnection("DataSource = xx'; user id = xx; password = xx;")
    
    Try
     'build the anonymous pl/sql
     Dim sb as New System.Text.StringBuilder
     sb.Append("declare")
     sb.Append(" l_N number;")
     sb.Append("begin")
     sb.Append("insert into movies (id,name) values (my_sequence.nextval, 'film1') returning id  into l_N;")
     sb.Append( "insert into category values (l_N, 'Category type');")
     sb.Append(" END;")
    
     'create commd object
    
     Dim cmd as New OracleCommand(sb.ToString,cn)
     cmd.Connection.Open()
     cmd.ExecuteNonQuerry()
     cmd.Connection.Close()
     cmd.dispose()
     Catch ex as Exception
    
      blah blah blah
    
    End try
    
      
    

    Published by: pollywog on May 28, 2010 10:48

    Published by: pollywog on May 28, 2010 10:49

  • How to single space in WordPad? I tried to check 1.0 I got the spacing box.

    I can't WordPad to single space.

    If you type a long line of text without using the key entry end of line (i.e., make the text line long enough so that it wraps automatically to the next line) corresponds to the spacing line spacing still?  If you have only spacing when you start a new line using the Enter key, go to the same place where you checked 1.0 for spacing and remove the check mark in front of 'Add 10 pt space after paragraphs.'

  • How can I change the default settings of the line spacing in Word Pad to: unique, space no space after a paragraph

    I need to change the default line spacing values to: simple space and NO space after a point, but it doesn't seem to be a way for that.
    Thanks for the tips.

    Press Ctrl + A to select your entire file, and then click the paragraph Options (the button at the bottom right in the paragraph on the Home tab group).  Uncheck "Add 10pt space after paragraphs."

    To create new documents this setting is already selected, follow these steps:
    1 - Create a new empty file, then follow the steps above to disable the spacing option.
    2 - save the file in the folder C:\Windows\ShellNew with a file name as "new WordPad file.
    3 - follow the steps on this support page to create a link from the context menu to create a new file based on this template: http://support.microsoft.com/kb/140333
    4. whenever you want to create a file with this option already set, just right-click on your desktop or in a folder and choose New > WordPad file.
  • How to single space lines in the report for MS Money 2002?

    When you print reports is it possible to single space lines as well as the report fits on a single page?  My OS is Windows XP.  Thank you.

    There is a forum dedicated to MS Money. Please transfer your question in the link below for money.
    http://social.Microsoft.com/forums/en/money/threads

    They will be able to better deal with your question.

    Thank you

Maybe you are looking for