Remove the String

I have haveselect Column1, which has the following output...

CN = Campagna, Samuel, OU = users, OR = QDC, OU = google, DC = DC = corp
CN = Kavanagh,-Peter J., OR users, OR = CED, UO = = google, DC = energy, DC = corp

and so on...


My next release should be
Also the ' \' in the middle of the name be removed

CN = Campagna, Samuel
CN = Kavanagh, Peter J.


Can someone tell me please how to do

Please try this-

with xx as(
    select 'CN=Campagna, Samuel,OU=Users,OU=QDC,OU=google,DC=DC=corp' col1 from dual UNION ALL
    select 'CN=Kavanagh,\ Peter J.,OU=Users,OU=CED,OU=google,DC=energy,DC=corp' from dual
)
select
    REPLACE(
        SUBSTR(col1,1,INSTR(col1,',OU=')-1), '\'
        )
from xx;

Output:

CN=Campagna, Samuel
CN=Kavanagh, Peter J.

I hope this helps.

Tags: Database

Similar Questions

  • Remove the string of code completely

    I tried several times to find this code below and replace it with nothing. I'm removing the add-on option basket of all the product pages. I used find with wildcards but do not know what I am doing wrong.

    Also I tried to paste the code below different ways to visualize correctly but nothing has worked as well.

    Basically just want to remove this code. He has an article in the code number. That's what I used the wildcard for. This seems to be the only difference in the chain of the form of the code.

    I used [^ ""]* for the wildcard. I tried just using the Toilet where is the item number. I tried to use the entire string, leaving only the form <>< / form >.

    Thanks for any help. I'm not a coder. No real paid on Dreamweaver.

    Dreamweaver CC 2015

    MacOSX 10.11.3 El Capitan

    " < form action =" http://www.maxokc.com/products/quotes/AddItem ' ' class = 'add-to-cart-method of the form' = 'post' accept-charset = "utf - 8" > < div style = "display: none;" ' > < input type = "hidden" name = '_method' value = 'POST' / > < / div >< input type = "hidden" name = "data [QuoteItem] [price]" value = "0.00" id = "QuoteItemPrice" / >< input type = "hidden" name = "data [QuoteItem] [product_id]" value = '48227' id = 'QuoteItemProductId' / >< div class = "form-inline" >
    < label for = "QuoteItemQuantity" > Qty: < / label >< input name = "data [QuoteItem] [Quantity]" style = "" width: 30px "value ="1"type ="text"id ="QuoteItemQuantity"/ >"< / div >
    < button class = 'btn, btn-big, add-to-Cart' type = 'submit' > < class i = 'icon-icon-sign white' > < / i > add to quote < / button >< / make >

    Use find & replace it with specific tag.

    Search form with the attribute action containing this URL.

    Remove the tag & content.  See screenshot.

    Make a test before making it on the entire local site.  You can't cancel it.

  • Remove the string from the text block

    I need to remove the following string "price: $5.80 -" block of text below... I have a bunch of text blocks similar to the one below, but they all have this kind of string to them ("price: $5.80 -")... Each text block has a 'price' and the end a '-' mark... Y at - it anyway to strip this line of each of my listings...

    M635
    Small ring Pull smooth w/back black patina
    Height: 1 3/16 "
    Width: 1 3/16 "
    "Projection: 1 3/16" 3/4 ".
    Base material: steel
    Screws: Screw Pack
    Price: $5,80-

    Thanks for the help!

    Discover the concept below code.

  • remove the string in double paragraph

    Hi, I wandered if someone had the best way to search for a string and delete the repeated subsections.

    For example, the input string may look like:

    T2, T2, T3, T6

    but I want to delete one of the T2 repeated, so the output would be:

    T2, T3, T6

    Note that the input string can be any length and a multiple of 4. I went through all the string functions and find nothing to match what I'm asking. I tried to use "String subset" in a wired loop in an output table.

    Any help in the right direction would be appreciated!

    Here's a handy dandy little tool that does just that.  The strings must be delimited by commas.  It is in LV2009.  If you do not, save the file and send it to the thread Downconvert VI ask.

  • remove the string space

    Hi friends

    I have a string containing spaces, are there any other function, the analysis chain, which allows me to delete all spaces

    (spaces are not at both ends)

    Thanks in advance

    How about StringUtilities.removeChars ()

    Something like this:

    String nouvelleChaine = StringUtilities.removeChars (myString, "")

    .. must remove whites.

  • Remove the string from txt file

    I have a .txt file (see table) I use the spreadsheet for the array function to retrieve the data I need. I am trying to extract over time of Inspection and the number doubles alongside that separately, but I have a problem with the delimiter. The .txt file will still not of this size, but the 1st and the last line will be the same


  • Remove the empty string

    Hi all

    Y at - it a script to remove the string empty in the channel palette.

    Here is an example for RGB or CMYK documents.

    //Only RGB or CMYK documents
    main();
    function main(){
    if(!documents.length) return;
    var doc = activeDocument;
    var PixCount =doc.width.as('px') * doc.height.as('px');
    var CH=[];
    var ChCount =0;
    if(doc.mode == DocumentMode.RGB) ChCount =3;
    if(doc.mode == DocumentMode.CMYK) ChCount =4;
    if(ChCount == 0) return;
    for(var a = ChCount;a		   
  • remove the line spacing of a string

    In the attached VI, I expected my output to a long chain, but instead, it's a chain with what looks like inserted line breaks. This is my output looks like:

    xx xx xx xx xx xx xx xx

    xx xx xx xx xx xx xx xx

    xx xx xx xx xx xx xx xx

    and what I want is:

    xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx

    Is there an easy way to remove the line breaks?

    Thank you

    Just do a "find and replace String" with LF as search string, empty string (or probably a space if necessary) as string to replace and replace all instances set to true.

    Hope this helps

  • Remove the unused characters from string

    Hi, I try to remove unused characters from a string, but I can't find a function for this.

    The string like: 0000 0000 0000 0000 0000 0000 0130 3130 3030 3030 3004 0000 0000 0000 0000 0000 0000 0000, I need the characters from 01 to 04.

    I need some advice.

    If the characters between the SOH and EOT had a NULL value, then Match Regular Expression can be a choice:

    Find \x01, find something else THAN \x04, then find \x04

  • remove the odd spaces of the hexadecimal string

    Hello

    I would like to remove the odd spaces to a hexadecimal string, and the output result.  That's what the input string will look like:

    01 00 04 0F FF 36 3B CC...

    I want the output to be:

    0100 040F FF36 3BCC...

    I got the attached forum labview code earlier, but it does not work with the text.

    Any help is greately appreciated.

    Thank you

    hiNi.

    Try this version 8.2.

  • remove the two zeros of hexadecimal string

    I'm passing an ASCII string of bench to a VI I wrote and I start with "04" and my VI the ASCII get normal "04".  I then have to convert an ASCII string to a Hex string (using a solution of VI, which I found on the web) and instead, having it display Hex '04', it adds two zeros in the Hex display "0004".  I need to remove the two zeroes don't is just "04".  I don't know there is probably an obvious solution (I'm fairly new to LabVIEW). Thank you

    A statement of format for a cast of just wiring operation confuses the programmer. Don't, don't. The value is not important as the type. (.. .and if you want a string, you can't even wire type.) String is the default!)

    What is the representation of the blue zero constant wired scheme down to the left of "hexadecimal string to munber '? Make sure it's U8.

    Please join the real VI, many things cannot determine in a single image. Thank you!

  • How can we remove the present space in the string in BlackBerry?

    Hello

    Suppose I have string like "New York". How can I remove the space between and do like "New York". As BlackBerry does not support the Java replaceAll() method, I am not able to do.

    Thank you...

    StringUtilities.removeChars (...)

  • How to remove the first few characters of a string of liquid

    I would like to delete the first three characters of a string of liquid. The question is how.

    If I use the markup according to liquid when I know what are the first characters

    {{it. {{["Estate status'] | strip_html | remove_first:"11."}}

    It will remove the 11 characters.

    But if I don't know what are the first characters, this markup can I use to get "RID" of the first three characters?

    I tried 'split' and 'slice', but it must always know what characters to split or slice.

    Thanks for any help.

    Kind regards

    Carla

    Assign a value into slices and you can have table data that you can get out.

  • helps to remove the encoded html string

    Hello

    I am trying to remove all the html to a user input string.

    something like this:

    < cfset string = "example text & lt;" a & gt; ">

    I tried:

    Replace (string , "< [^ >] * >", "", "ALL")

    Replace (string , "& lt; BR & #x2f. & gt; (' > ', ' ', 'ALL')

    Can or remove the html code, someone help?

    Functions related to the replacement of strings using regular expressions are REReplace and REReplaceNoCase. For example,.

    #REReplace(string, "<[^>]*>", "", "ALL") #

  • Remove the schema from a string

    Hello

    I was wondering if there is any better way to do something like that?
    SELECT 
        REPLACE( 
          REPLACE( 
            REPLACE(
              'SOMETHING .A .B .C Something else !', '.A',''),
            '.B', '' ),
          '.C', ''
        )
    FROM DUAL;
    This is just one example. My real case is a little more complex. So I would remove the. A. B. C. now I use REPLACE followed by the template should be deleted and I put an empty string as a replacement string. And it does the job properly. But I was wondering if there is another way that can avoid me using 3 Replace.

    Thanks for your help,

    user13117585 wrote:
    Me being stupid again...

    Sorry for this stupid question.

    SELECT
    TRANSLATE('SOMETHING .A .B .C Something else !', ' .A.B.C',' ')
    FROM DUAL;
    

    Not a stupid question at all. Assuming that you want only to remove the actual strings. A. B and. C, so it is actually more difficult than it sounds. Consdier:

    SQL> SELECT TRANSLATE(x, ' .A.B.C',' ') xlate,
      2         REGEXP_REPLACE(x, '(\.A)|(\.B)|(\.C)') rexp
      3  FROM (SELECT 'SOMETHING .A .B .C Something else !' x
      4        FROM DUAL
      5        UNION ALL
      6        SELECT 'SAMETHING .A .B .C Another Bit !'
      7        FROM DUAL);
    
    XLATE                               REXP
    ----------------------------------- -----------------------------------
    SOMETHING    Something else !       SOMETHING    Something else !
    SMETHING    nother it !             SAMETHING    Another Bit !
    

    John

    Published by: John Spencer, March 8, 2011 09:10
    ADED the SQL instead of just the results

Maybe you are looking for

  • My account has been hacked and purchase

    How can I make sure that this monthly subscription does not pass by? I changed my password and checked my subscription space but can not see this purchase. Buyer ID: NUMUYTSRX Purchase of: Ronald Iphone He thought that he would treat himself to a mon

  • Need a driver to download for my Hp Pavilion a1247c model

    I have a HP Media center HP Pavilion a1247c pc model. I formatted the hard drive and I tried to reinstall the operating system to an Emachine CD in the computer I have has come with the operating system CD when I bought new in 2005. I managed to inst

  • Album art shows in slide show?

    During playback of music in media center of vista, if I click play slide show to display a random slideshow of our pictures, it also shows the album art. Is there a way to specify the directories to use for images that is different from the direcctor

  • Computer restart causes reset IE8.

    Restarting the computer leads the Favorites (including link bar) menu to reset/reload of many Microsoft Web sites. Is this just aggressive marketing by MSFT?  How can I stop it?  I'm using XPSP3.  This just started happening a week ago.  budha45

  • Not able to play Star Trek Armada 2

    trying to play a game compatible with xp on windows 7 and will not work. solutions? Trying to play Star Trek Armada 2 on windows 7 and it won't work. solutions?