473,799 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

char replacement

Hi,
I have a table with a field that contains a file path(www/docs/.../.../...)
Some of the path contain this characters 'é' or 'è'.
How can i do an update on this table to replace only the characters 'é' or
'è' by a 'e'.
Thanks for your ideas
VooDoo
Nov 3 '05 #1
2 1556
VooDoo wrote:
How can i do an update on this table to replace only the characters
'é' or 'è' by a 'e'.


In PHP:

$subject = 'somé linè';
$search = 'éè';
$replace = 'ee';
$updated = strtr($subject, $search, $replace);

or

$subject = 'somé linè';
$search = array('é', 'è');
$replace = 'e';
$updated = str_replace($se arch, $replace, $subject);

But I guess you need a SQL query ("table with a field"). Better ask in
comp.databases. mysql or have a look at
http://dev.mysql.com/doc/refman/4.1/...functions.html It might be

UPDATE t1 set f1 = REPLACE(REPLACE (f1, 'è', 'e'), 'é', 'e')

--
E. Dronkert
Nov 3 '05 #2
It works! thanks a lot for your answer!
cya
VooDoo
"Ewoud Dronkert" <fi*******@last name.net.invali d> a écrit dans le message de
news: sa************* *************** ****@4ax.com...
VooDoo wrote:
How can i do an update on this table to replace only the characters
'é' or 'è' by a 'e'.


In PHP:

$subject = 'somé linè';
$search = 'éè';
$replace = 'ee';
$updated = strtr($subject, $search, $replace);

or

$subject = 'somé linè';
$search = array('é', 'è');
$replace = 'e';
$updated = str_replace($se arch, $replace, $subject);

But I guess you need a SQL query ("table with a field"). Better ask in
comp.databases. mysql or have a look at
http://dev.mysql.com/doc/refman/4.1/...functions.html It might be

UPDATE t1 set f1 = REPLACE(REPLACE (f1, 'è', 'e'), 'é', 'e')

--
E. Dronkert

Nov 4 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
6545
by: Axel | last post by:
Hiho, here my Newbie question (Win32 GUI): I'm reading a file in binary mode to a char* named buffer. I used malloc(filesize) to make the needed space avaiable. The filedata in the buffer seems to be ok..I can write the variable buffer back to a file and the contents is ok. So I think until here all goes fine... But now I want write the buffer contents to a Memo-Box for displaying.
3
9748
by: Vibha Tripathi | last post by:
Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject) method/function, I need the second argument 'replacement' to be another regular expression ( not a string) . So when I find a 'certain kind of string' in
30
5073
by: Tim Johansson | last post by:
I'm new to C++, and tried to start making a script that will shuffle an array. Can someone please tell me what's wrong? #include <iostream.h> #include <string.h> int main () { srand(time(0)); int array_length; int count;
10
2422
by: Scott McPhillips [MVP] | last post by:
I have a fixed-size string array like this char m_titles; and can't figure out how to change it to a dynamically-sized vector like this: std::vector<char> m_titles; The declaration compiles but then calling reserve or resize leads to
1
1247
by: lothar.behrens | last post by:
Hi, I had or even have a problem with functions, that are returning char arrays. I want to translate text that should be internationalized. So the following function definition, I thought, would be good: char* translateText(char* text);
5
29500
by: dmhendricks | last post by:
Greetings, I have a question. I work on some SQL2k/ASP.NET apps at work. My predacessor, who created the databases/tables seemed to have liked to use 'char' for all text fields. Is there a reason why he would have done this over using varchar? It's a minor annoyance to always have to RTRIM data and it makes directly making changes to the database more annoying (with all the pointless trailing spaces)? I usually use char for fixed...
7
21711
by: VMI | last post by:
If I have the string "Héllo", how can I replace char (é) with an 'e'? I cannot use the String.Replace() fuction. It has to be by replacing one char with another. Thanks.
74
4611
by: aruna.mysore | last post by:
Hi all, I have a simple definitioin in a C file something like this. main() { char a; ....... int k; }
2
2442
by: =?Utf-8?B?U3RldmVu?= | last post by:
Hi, I'm new at Visual C++ and I can't figure out how to change the text property of a label. I'm using a char variable that I'd like to assign to the label. Perhaps I should use a System::String^ instead? But when I try that, I get an error that I can't use a System::String^ as a global or static variable. What I want to be able to do is the change say the third character of the text in the text property of the label control from, say,...
13
3756
by: Hongyu | last post by:
Hi, I have a datetime char string returned from ctime_r, and it is in the format like ""Wed Jun 30 21:49:08 1993\n\0", which has 26 chars including the last terminate char '\0', and i would like to remove the weekday information that is "Wed" here, and I also would like to replace the spaces char by "_" and also remove the "\n" char. I didn't know how to truncate the string from beginning or replace some chars in a string with another...
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10247
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.