Replacing a special unprintable character
Hello:
What update query can I run to cleanup data
such as this
Description
For as well as a brief appearance in the HBO movie special, Miss Evers Boys,
in our database. I will like to replace
this character with a null.
Thanks in advance..
As already suggested in another thread:
SQL> UPDATE your_table
SET col = REPLACE(col,'','')
/
Similar Messages
-
Replacing a special character in a string with another string
Hi
I need to replace a special character in a string with another string.
Say there is a string - "abc's def's are alphabets"
and i need to replace all the ' (apostrophe) with &apos& ..which should look like as below
"abc&apos&s def&apos&s are alphabets" .
Kindly let me know how this requirement can be met.
Regards
SukumariREPLACE
Syntax Forms
Pattern-based replacement
1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
pattern
IN [section_of] dobj WITH new
[IN {BYTE|CHARACTER} MODE]
[{RESPECTING|IGNORING} CASE]
[REPLACEMENT COUNT rcnt]
{ {[REPLACEMENT OFFSET roff]
[REPLACEMENT LENGTH rlen]}
| [RESULTS result_tab|result_wa] }.
Position-based replacement
2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
[IN {BYTE|CHARACTER} MODE].
Effect
This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible.
When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2.
In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new.
System fields
sy-subrc Meaning
0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj.
2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right.
4 The subsequence in sub_string was not found in dobj in the pattern-based search.
8 The data objects sub_string and new contain double-byte characters that cannot be interpreted.
Note
These forms of the statement REPLACE replace the following obsolete form:
REPLACE sub_string WITH
Syntax
REPLACE sub_string WITH new INTO dobj
[IN {BYTE|CHARACTER} MODE]
[LENGTH len].
Extras:
1. ... IN {BYTE|CHARACTER} MODE
2. ... LENGTH len
Effect
This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new.
The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character.
During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t.
System Fields
sy-subrc Meaning
0 The subsequence in sub_string was replaced in the target field dobj with the content of new.
4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new.
Note
This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant.
Addition 1
... IN {BYTE|CHARACTER} MODE
Effect
The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type.
Addition 2
... LENGTH len
Effect
If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected.
If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted.
Example
After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that".
DATA: text1 TYPE string VALUE 'I know you know',
text2(18) TYPE c LENGTH 18 VALUE 'I know you know',
sub_string TYPE string VALUE 'know',
new TYPE string VALUE 'should know that'.
REPLACE sub_string WITH new INTO text1.
REPLACE sub_string WITH new INTO text2. -
How can I replace the Special Character '
Hi Guru ,
I want replace one Special Chareacter into space .
Example -
There have one variable .
L_VAR = BANGA'LORE
I want to delete the special character ( ' ) which is between A and L .
Whenever I am tryiny to use replcae statement , it will show one Error Message .
REPLACE ''' IN L_VAR WITH ' '.
IT WILL GIVE ONE ERROR MESSAGE - " Literals that take up more than one line are not permitted."
How Can I replace this .Hi Tarak Dey,
This error
Literals that take up more than one line are not permitted
is not for the Replace statement. You would have missed a PERIOD in some statement before this.
When we see the code that you have pasted,
L_VAR = BANGA'LORE
here period is missing at the end of the line. The error could be because of that.
Kindly check.
Best Regards,
Ram. -
Replace function - special characters
Hi All,
If my column is encountering special characters I would like to replace with blank. Special characters may vary from record to record. Sometimes it is @ sometimes $,!,,$,^,<,&,<,>,?,",{,},+,_,),(.
Do we have any function same like replace that can replace all special characters, whatever it encounters with required value?
- please mark correct answersTake a look at this article
T-SQL:
How to Find Rows with Bad Characters
and check See Also section in that article for more articles on that topic.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles
Thanks Naomi
- please mark correct answers -
Find and Replace more then one character
Hi
I need to find and replace more then one character. for example: I need to replace "A" with "a". "B" with "b" and so on. how to do that in one search?See the following script by Peter Kahrel:
Change case
http://www.kahrel.plus.com/indesign/grep_change_case.html
If the "A" and the "B" are in arbitrary positions in your text you could use the following GREP:
[AB]
together with the script.
For testing your GREP expressions, you could use the following script, also by Peter Kahrel:
A GREP editor
http://www.kahrel.plus.com/indesign/grep_editor.html
Uwe -
How to replace key value with character
Hi Experts
Can any one tell me, how to replace key value with character, whether it is possible are not. My present report is displaying below format.
country--city-area-flatnocountry--City-Flatno
Customer--USACOst1111---UK--HD20--
C100--11---11--
C200--11---1--
For the above example format i am able to display. But now i want to replace 1 with character value for example. For C100
country is USA at presnt 1 but it should replace with USA.
You find required format below.
country--city-area-flatnocountry--City-Flatno
Customer--USACOst1111---UK--HD20--
C100--USACOst1111--
C200--UK--HD20--
thanks .
Regards,
Vishal.Hi Markus,
Thanks for reply,
Actually i dont have attribute for the customer, the data is maintained in ods, in the form, customer name one info-object and customer value one more info-object this value got text. This value stored in the ods as below
costomer number customer value
C100--USA
-C100CO
C100--11-
C200----
UK
C200----
20
Please let me know any clarification you need.
Thanks and Regards,
Vishal. -
Find and replace a combination of character formats
Hello all,
Is it possible to find and replace a combination of character formats.
for example:
Search for VA. The V in Arial and the A is Helvetica.
Replace this in V Arial and A in Verdana.
Regards.NutTriooo wrote:
Hello all,
Is it possible to find and replace a combination of character formats.
for example:
Search for VA. The V in Arial and the A is Helvetica.
Replace this in V Arial and A in Verdana.
Regards.
If the letter pairs are always the same, change one manually, then copy to clipboard. Find whatever; in the change to pop-up menu under the "@" symbol, Other > Clipboard Contents Formatted.
HTH
Regards,
Peter
Peter Gold
KnowHow ProServices -
How to replace XML special characters using Xpress e.g. ' = '
Hellos
I need to write some XML built from resource data.
The resource data strings can contain anything e.g. & ' " < and > characters.
How do I replace these characters with the strings & ' " etc.... from within Xpress?
I try something like:-
<set name='testchar'>
<switch>
<ref>thisLetter</ref>
<case>
<s>'</s>
<s>'</s>
</case>
<case>
<s>"</s>
<s>"</s>
</case>
<case default='true'>
<ref>thisLetter</ref>
</case>
</switch>
</set>
But when saved the <s>'</s> gets saved as <s>'</s>
Is this impossible with Xpress forcing me to invoke my own Java class? (which is a pain to do because of internal politics re restarting of App Server).Hmmmm seems there is transformation in this set up too.
What I am trying to do is to parse a string which may or may not contain XML special characters into an XML acceptable string.
e.g. transform the surname O'Connor into O&apos ;Connor (with no embedded blank)
I wish to write a rule which uses XPress language to achieve this.
I want to convert the character ' into the string &apos ; (with no blank between apos and ;) and similar for the other XML specials.
Is this possible? -
Replacement of special chacters
Hi.
I'm trying to replace special characters in a string but I must be doing something wrong.
I've tried : select replace(chr(248), chr(248), chr(195)||chr(184)) from dual
and get a null-value back
I've also tried to replace on a 'proper' column.
But all that happens is the character is removed from the string, not replaced.
Any ideas?Which are you using? Well my language is ENGLISH and my territory is UNITED KINGDOM but the important one is the NLS_CHARACTERSET and that is WE8MSWIN1252.
One point that does occur to me is, is this a SQL*Plus issue? It's not uncommon for the client to have different NLS settings from the database, with the outcome that stuff seems not to work in SQL*Plus but does work on the server.
Cheers, APC -
Replace all special characters in a String with underscore
I have a String which contains some special characters even(!,$,@,*....).
I need to replace all the special characters with _ in my String. I do have an idea of using String.replace() and analogous forms, but I would be thankful if anyone can suggest me of a better and an efficient way.
regards,
fun_oneKaj,
Thx for your earnest reply. I did have a peep into the API on this method. But the regular expression that I need to use here was beyond my understanding. It did specify some regex that I put to use (something like myString("\D","_"), assuming that I need to replace all non-digit characters ), but it really did not help me getting the result.
Would you spare some code for me reg. the usage of regular expressions in such a scenario?
cheers,
fun_one -
Replacement of special characters through hex-code
Hi,
I create a xml-output via SYS_XMLTYPE- and XML_ELEMENT-functions. In the coulumn values I select special XML-Characters like the ampersand will be automatically replaced through their quivalent Escape code (&) - But our special german characters (ä, ü, ö, ß) won't be replaced. Is there a function to replace them or do I have to write my own function?
Bye,
JensHi Mark,
now I have a problem with the replacement (You must replace $ through an ampersand to understand the code, the ampersand would be automatically replaced)
The following query:
SELECT XMLELEMENT( "city", a.city,
XMLELEMENT( "company", a.company )
) AS XML_DATEN
FROM (
SELECT 'München' AS CITY, 'MCM' AS COMPANY
FROM dual
UNION
SELECT 'Hamburg' AS CITY, 'P$C' AS COMPANY
FROM dual
) a
returns
<city>Hamburg<company>P$amp;C</company></city>
<city>München<company>MCM</company></city>
Ok, that's fine. The XMLELEMENT function automatically replaces the ampersand. But the "ü" do I have to replace for myself.
But when I do it:
SELECT XMLELEMENT( "city", REPLACE( a.city, 'ü', '$#'||ASCII('ü')||';' ),
I got the following:
<city>M$amp;#252;nchen<company>MCM</company></city>
And not:
<city>M$#252;nchen<company>MCM</company></city>
How can I solve this problem? -
HELP : Replacing Space with any character !
Hi !
How do I replace any spaces in a strings passed from a FORM INPUT, with a different character.
I tried doing this
String s= request.getParameters("info");
s.replace(' ','_');
But it keep giving me error.
it there any simpler way of doign this?
Thank you
KHi !
I am new to JSP,
It keep giving a null pointer exception when i use it with JSP
So i did this it work fine on the try section
and once it is in the catch section it keeps giving me Nullpointer exceptions again.
IS there any other way replacing the space with a "-" or anything..?
Thanks for your help.
here is the code
String r_space ="";
try {
r_space=value.replace(' ','+');
out.println("r_space : try " r_space "<br>");
catch(NullPointerException e) {
System.out.println("Recaught: " + e );
r_space=value.replace(' ','+');
out.println("r_space : cathc" r_space "<br>"); -
Users have the ability to set replace-with shortcuts to use throughout applications; however the Spotify application does not currently support this feature. In addition, users also have the ability to press Control + Command + Spacebar to show the Character Viewer in applications, but Spotify does not support this feature either. I would love to see these features added to the Mac Application. This only really applies to sharing and messaging (one of the core features of Spotify).
Updated: 2015-07-28Marked as new idea and edited it to let it focus on 1 request only.
Feel free to submit your 2nd request in a new topic. ;) -
Replace any special charecter with space
Hi all,
I would like to remove any occurence of special charecter that may belong to specific language(ä) or (* & %).
The input may be a string in parameter variable or a file input.
Regards,
Souryahi,
constants: con_cr type x value '0D'. or try '0D0A'
replace con_cr with space into X.
else
go through this"http://help.sap.com/abapdocu_70/en/ABAPREPLACE_IN_PATTERN.htm"
cheers,
Bhavana
Edited by: Bhavana Amar on Apr 15, 2010 8:18 AM -
Maintaining Special Invalid Character "Square" in BW
Hi Gurus,
I am actually trying to load some data from CRM, where the file has some hexadecimal numbers inbetween with 'Squares'. I tried maintaing the Invalid characters in RSKC, but I am not able to paste this special character there. Can anyone help me out in solving this problem. I tried in taking the error screen shot, pasting in MS paint, but the suare is dissapearing and a space is showing in MS point. Manual maintanance in PSA is possible, its a tedious process. Anykind of help is appreciated.
Thank You.
Anil.Hi Anil,
You may want to check if the file with 'squares' is valid data and if it needs to be loaded as such. I have seen 'squares' being generated in flat-files in the process of creation. If I remember right the 'squares' stood for characters the code-page did not recognize.
Best regards
Mathew.
Message was edited by:
Mathew Muthalaly
Maybe you are looking for
-
Rev account determ based on customer account assign group of ship to party
Hi In our company revenue account gets determined based on Sales org/cust acc assignment group / mat acc assignment grp / Dest Cntry / ActKy (VKOA table 502) . Customer account assignment group and Dest country are from sold to party customer account
-
Output of input type=file.... <input type="file" name="frm_filepath" value="" size="100"> In IE frm_filepath : C:\mappingfiles\2006\map.txt In firefox frm_filepath : map.txt How can i get full path and file name in firefox like IE?.
-
Insert date without using todate
Hi Whenever I execute the following query I get an error INSERT INTO HTCALLMASTER (CALLID,REFERENCEID,CALLERID,CATEGORYID,PROBLEMTITLE,PROBLEMDESCR,STARTDATETIME,STATUS,LOGMEDIUM) VALUES ('1122','12','M70615','1','DGFG','FDGDG','22-DEC-2005 08:20:56
-
New users Email not verfied. 550 error
Hi everyone, Very new to servers and am in this position because our IT guy quit and we had to add new users. I added them and everything else works except they can not send or recieve emails. It bounces back, organization rejected.. 550 verificatio
-
NullPointerException in BasicTableHeaderUI
Hi, I am populating an JTable with some information. everything works fine but while populating table am getting following exception(still am able to populate table correctly) Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at j