Need to replace specific characters of columns

Hello.

I searched the forum and found examples to follow, but I'm stumped. I am using regex_replace to replace special characters in a column with a space. The characters are as follows: #/--------| <>* $?; :, @' ^

I got this close:
SELECT NAME,
REGEXP_REPLACE (NAME, ' [#/--------| <>* $?;:, @^] ',' ')
OF PRODUCT_DESIGNS

My problem is: How can I replace the apostrophe? I can't make it work in the same REGEX_REPLACE like all the other characters.

Thanks for your time.

Dan

Hello

TRANSLATE is more effective than REGEXP_REPLACE to do this:

SELECT     name
,     TRANSLATE ( '#/\|*$?;:,@^'''
            , '             '
            )
FROM    product_designs
;

To include a single quotation mark in a string literal, use two of them in a row.
Notice how the first argument to TRANSLATE above:

,     TRANSLATE ( '#/\|*$?;:,@^'''

is written with 3 consecutive single quote at the end characters. The first two show a single quotation mark in the literal and the third one ends the literal.

You can also use Q-rating to include a single quotation mark in a string literal:

,     TRANSLATE ( q'<#/\|*$?;:,@^'>'
            ,  '             '
            )

Published by: Frank Kulash, August 20, 2010 12:03
Added example of scoring Q

Tags: Database

Similar Questions

  • Replace sepcial characters in a Server stored on via PLSQL

    Hi Experts,

    I have a requirement in which I need to replace special characters by alphabets in a file stored on the server in a directory.

    EG - symbol € with E

    symbol (at) with @.


    I want to do this via a Pl Sql stored procedure.

    I tried and script worked great for small files, but it is a failure for large files.


    for your Script reference, I've been trying-


    DECLARE

    l_tmp_blob by DEFAULT EMPTY_BLOB() BLOB;

    l_bfile BFILE.

    l_dest_offset INTEGER: = 1;

    l_src_offset INTEGER: = 1;

    l_file_content VARCHAR2 (32767).

    l_outfile UTL_FILE. TYPE_DE_FICHIER;

    BEGIN

    l_bfile: =.

    BFILENAME ('TEST_ATTACH ','TEST_ZERO_SIZE.txt '

    );

    DBMS_LOB. OPEN (l_bfile, DBMS_LOB.file_readonly);

    DBMS_LOB.CREATETEMPORARY (l_tmp_blob, TRUE);

    DBMS_LOB.loadblobfromfile (l_tmp_blob,

    l_bfile,

    DBMS_LOB.lobmaxsize,

    l_dest_offset,

    l_src_offset

    );

    DBMS_LOB. CLOSE (l_bfile);

    BEGIN

    SELECT mob_util_pck.blob_to_varchar (l_tmp_blob)

    IN l_file_content

    Double;

    END;

    Start

    mob_util_pck. DELETE_FILES ("TEST_ATTACH",

    'TEST_ZERO_SIZE.txt '.

    );

    END;

    l_file_content: = REPLACE (l_file_content, ' €', 'E');

    l_file_content: = REPLACE (l_file_content, ' @', '(at)');

    l_file_content: = REPLACE (l_file_content, '&', '+');

    l_file_content: = REPLACE (l_file_content, 'to', 'a');

    l_file_content: = REPLACE (l_file_content, 'e', 'e');

    l_file_content: = REPLACE (l_file_content, 'e', 'e');

    l_file_content: = REPLACE (l_file_content, c ","c");

    l_file_content: = REPLACE (l_file_content, 'e', 'e');

    l_file_content: = REPLACE (l_file_content, 'u', 'u');

    l_file_content: = REPLACE (l_file_content, 'e', 'e');

    l_file_content: = REPLACE (l_file_content, 'i', 'i');

    l_file_content: = REPLACE (l_file_content, ' \', ' / ');

    l_file_content: = REPLACE ([l_file_content, '] ',')');

    l_file_content: = REPLACE (l_file_content, ' ^ ','.');

    l_file_content: = REPLACE (l_file_content, '_', '-');

    l_file_content: = REPLACE (l_file_content, "',"');

    l_outfile: = UTL_FILE. FOPEN ('TEST_ATTACH', 'TEST_ZERO_SIZE.txt', 'w');

    UTL_FILE. PUT (l_outfile, l_file_content);

    UTL_FILE. FCLOSE (l_outfile);

    END;

    /

    Please help me with this.

    Regards-

    Vikrant

    I'm testing with CLOB, but I don't know if I can REPLACE on CLOB and write a file with the CLOB.

    REPLACEMENT work, UTL_FILE doesn't.

    You can use, for example:

    DBMS_XSLPROCESSOR.clob2file (l_tmp_clob, 'TEST_ATTACH', 'TEST_VIKS1108062013115301.xml');

  • replace the characters with accent with their basic letter

    Hello

    I need to replace the characters with an accent with their basic letter

    a = > has
    n = > n

    I use classes of equivalence as [[= n =]] in regexp_replace, but then I need to call it for each letter. Is there a simpler way?

    Concerning
    Marcus

    Given that I only have the names to convert INITCAP

    It seems that you can use the binary case-insensitive or accent sorting to get the results you want so:

    SQL> with t as (
     select 'ñÉäßÑéàâ' str from dual
    )
    --
    --
    select str, utl_raw.cast_to_varchar2((nlssort(str, 'nls_sort=binary_ai'))) str2 from t
    /
    STR      STR2
    -------- ---------------
    ñÉäßÑéàâ neassneaa
    1 row selected.
    
  • How do I identify an original 5 c iPhone screen. I need to replace mine.

    How do I identify an original 5 c iPhone screen. I need to replace mine. I am in Ghana and there is no apple here store. Please contact me

    < email published by host >

    I asked guests to remove your e-mail address. It is an invitation to spam. If you left the default settings for your account, you will probably have to automatically get an email notification of this response so there is no need to ask.

    No doubt if you shop for parts online, you have to trust that the source will be not only deliver, but deliver to the correct specification for your device. You must also be able to perform the repair. There isn't really any practice Council or recommendation that can be offered here.

    TT2

  • I need to replace the battery and AC adapter of the Satellite Pro U400-160

    I have a Satellite Pro U400-160.

    I need to replace the battery and the charger of my Toshiba, but I am wary about compatibility issues.

    Any battery for Satellite Pro U400 is suitable for mine?
    As I can't find which batteries are specifically suitable for my computer.

    (For example: is this a: http://www.amazon.es/Bater%C3%ADa-Toshiba-Satellite-U400-11V-7800mAh/dp/B0051A9Y88/ref=sr_1_cc_2?s=aps&ie=UTF8&qid=1366885340&sr=1-2-catcorr&keywords=satellite+pro+u400?)

    Is there a quick way to check if a battery / charger are compatible?

    Each battery and adapter you get from Toshiba has specific part number. All you have to do is use this same part number and order. You should be able to find on the internet.
    You can also get compatible parts you are ordering by the Toshiba authorized service provider in your country.

    By the way: all U400 models have the same construction and the similar specifications then all the batteries specified for U400 can be used on your U400-160.

  • You need to replace a hard drive in XPS 8300...

    Hello

    the hard drive on my XPS 8300 failed and I need to replace. I know that my data will be lost, but if I replace hard drive how to return applications such as Microsoft Office, I had already installed? They did not come on CD, but have been preloaded when I bought the computer.

    Thanks for the replies.

    Manage, download, save or restore specific products:

    Products.Office.com/.../Download-back-up-Restore-Microsoft-Office-Products

  • Replace special characters

    Hello

    I need SQL or PL/SQL code to replace special characters such as!, @, #, $, %, ^ of the given string.

    For example, if the given string is

    "it is - test * strin #g to @ spe % ial charact!" ERS"he should replace all special characters and provide the output voltage

    It's test string with special characters

    Please enter the code

    Thank you

    You have commas in the character set block and the [[: alnum:]] is equivalent to [a-zA-Z0-9], you may want to include a space in this updated chacter block.

    Select REGEXP_REPLACE ("This is test * strin #g to @ spe % ial charact!") ERS ',' [^ [: alnum:]] *', ")

    of the double

    Output

    It's test string with blue characters

    EDIT: I do not know what will want the characters allow the OP. For example, a comma, question mark, comma, colon, apostrophe, full stop etc. are all valid in a sentence.

  • Police is displayed correctly with the exception of specific characters

    Hello!

    I try to use several fonts in Adobe CC 2015 and while the selected font appears, the specific characters are not.  For example.

    If I'm typing: what's up?

    It displays as: what s upward?

    Or it will not display the ': what s upward?

    I used the same fonts in other applications such as Word and I do not have this problem at all. So far I have discovered that if I change the font for a font which will show you the lack of character as rectangles, then I add in the apostrophe (or another tank missing) it works fine.  It seems that the lack of character must appear as the right rectangle - I can't just change to any font.

    Is it me?

    Confused.Untitled-1.jpg

    Maria,

    I have the definitive answer regarding these two fonts.

    First of all, they are publicly downloadable fonts on dafont.com. I downloaded them reviewed with a publisher of professional fonts and this is what I found.

    For fonts JamesFajardo, opening and closing single and double quotes typographical are actually defined in the police as a draft. Therefore, since the characters are well-defined, InDesign (and all Adobe applications) use as-is. Which translates to white display test. If you want an apostrophe, overlay which to replace the closing quotation mark will make your viewable and printable document.

    For fonts Hanshand, opening and closing single and double quotes typographical are defined at all in the police. Thus the .notdef glyph (this square box) is used. This is completely consistent with the specification for the use of these fonts. As in the case of the police of JamesFajardo , if you want an apostrophe, overlay to replace the apostrophe closing will make your viewable and printable document.

    By default, InDesign uses the quotes when the overlay even place or paste text. So, if your Microsoft Word document had used a typographic-no apostrophe, then import that would produce a conversion to get what you see. Also, when the overlay in Microsoft Word (or other office applications), if you have this option is disabled, you will not get any attempt to replace the automatic.

    However, is that these two policies are fundamentally flawed because common characters used in Western Latin language available are missing and in the case of JamesFajardo, the police are actually defective, to distinguish these characters as a draft.

    For your entertainment and edification, I am attaching to this answer the tables of output for these two fonts font so you can see exactly what is defined in them. Ironically, a similar chart appears on dafont.com web pages associated with each of these fonts.

    Sorry for the inconvenience that you have been through, but there is not much at Adobe, we can help you with these fonts.

    -Dov

  • Specific characters prevent the input Textfield.

    Hello

    There is a .restrict attribute, but as the defined it prevents only other characters to enter in the textfield, restricting the TextField to the characters given.

    I want to prevent the entry of the textfield of characters 1-10 .

    The code below does not properly work.

    txt. Border = true; //


    function down(event:KeyboardEvent):void

    {

         /*

    for (var i: uint = 48; i < 58; i ++)

         {

    If (event.keyCode == I)

              {

    txt.text = txt.text.replace(/.$/,""); "

              }

         }

    */

    No. ASCII, no RegExp

    for (var i: uint = 0; i < 10; i ++)

         {

    If (txt.text.indexOf (String ((i)))

              {

    txt.text = txt.text.replace (String (i),"" ");

              }

         }

    }


    stage.addEventListener (KeyboardEvent.KEY_DOWN, down);

    It must surely be built in method.

    You can restrict the entry of specific characters using the ^ character... only one problem with your intentions... 10 isn't a character...

    TField.Restrict = "^ 0-9.

  • My Apple Watch broke last week and I need to replace it as soon as POSSIBLE, technical support has expired but the coverage of active services

    My Apple Watch broke week last series only. FH * JC, I need to replace it as soon as POSSIBLE, the technical support has expired but the coverage of active services.

    Thank you

    < published by host >

    Contact Apple support (mail service may be available) or make a booking Genius Bar to make arrangements for your watch serviced (warranty, if it qualifies):

  • Portege Z830 - screen broke and I need to replace

    Hello

    I have Toshiba Portege z830. My screen broke and I need to replace it.

    Is it possible to install an IPS display instead of the original LTN133AT25-601? What IPS screen is compatible with LTN133AT25-601?

    Hello

    The original LCD that has been used in Z830 was a 13.3 TFT color LCD "(HD) 1366 x 768."
    So if you want to use any other presentation, then you should pay attention to the size of the screen and the connectors.
    I think these are the most important key elements.

  • HP G62: I have hp g62 laptop that I need to replace the hard disk but I don't have a lap desk

    I have hp g62 laptop comes with windows 7 Home premium and Microsoft last year offered 10 edition windows Home premium.
    Suddenly the windows closed was a message "hard drive does not exist" or "boot device not found", said another time.
    I need to replace in the old hdd but I don't have a lap desk. The recovery file was recorded in a single partition on the old hard drive.
    How to get started with the new hard drive and recover the old windows, I need help please thank you.

    Concerning

    computer laptop laptops installed new hard drive there is message "no partition active" and "no boot device" what I need to do to install windows 10.
    I have no office to boot, I used to run the wind. last summer and 7 MS offered upgrade to the wind. 10 how premium and activated, of I need help thanks
    Concerning

  • Satellite M30X-115: I need to replace the screen

    Hello

    I need to replace the screen on my laptop but I can't find references one is on. Is it possible to have this references or references to a compatible standard model and of course, an easy to find the object: o)
    Thanks for the help of the Tower

    Hello

    As far as I know the Satellite M30X was delivered with a screen 15.4 "(1280 x 800) view wide TFT color display."

    Only the dimensions of the screen are important. So if you want you can search a 15.4 "display.
    By the way; the display is one of the most expensive parts of laptop. Perhaps a second hand M30X, or a display of second hand would be a better solution as to buy a new screen for around $ 300.

    Greetings

  • Satellite Pro 2100: need to replace keyboard

    I have a sp 2100 with keyboard problems. I need a replacement, but I can't find sp2100 keyboard. are there other toshiba laptops with the same keyboard?

    Hi Martin,

    In my view, the part number of the keyboard you need for you SP2100 is P000405490 and this will depend on the different models, including the Qosmio E10 F10, G10, 210 A40 Satellite 1410, M30 etc.

    Try Googling for one, there are several listed companies.

    Kind regards

  • Need to replace battery for my Portege M200

    I now only get around 45 minutes out of the battery in my Portege M200 and need a replacement. The original is a PA3191U-3BRS but I can not find this list on the Toshiba web site. She has been replaced and if so, what model should I? Standard rather extended life is fine fo me.

    Thank you very much
    Neill

    I found the info that you can use the battery with PA3191U-3BAS part number. Put this number in Google and you will find many online shops where you can order. You will see that Portege M200 is listed as compatible portable model.

Maybe you are looking for

  • The HP bios code

    Hello, I'm having problems with my HP Pavilion start and went to watch the boot seq in my BIOS and I cannt gain access. I get a code after 3 attempts to default password 58101397 Can someone please help? Thank you

  • HP Pavilion Notebook 15-p012ne: HP pavilion p 15 012 ONLY

    Hi guys! New in the forum. I recently bought a HP Pavilion 15 p012ne. I was reading this model quite some time and now ive bought. basically because im an AMD fan (AMD user since 2009) However, the shop I got my unit gave me a unit which has no dedic

  • System Volume Information

    I was looking for a way to remove a contaminated deposited hidden in my folder of the system volume.  I get access is denied when I try to enter. I turned off my System Restore as recommended and rebooted as recommended... I'm on my admin profile and

  • Update of security for Microsoft Office PowerPoint 2007 (KB2596764)

    I attempt in install the following update: Security for Microsoft Office PowerPoint 2007 (KB2596764) and even installed Microsoft Fix it and I keep getting an error message that the update was not installed. Currently, I use Kaspersky Internet securi

  • Stop Auto loading software.

    You had a program called Software Explorer, which would prevent programs such as aol to load on its own. You still have this program for download.