RE: using replace() to remove tab chars
On Wed, 1 Mar 2006, Price, Randall wrote: } Try the following: } } REPLACE(products_description, CHAR(9), " ") Thanks, Randall, that did it. And I feel quite stupid, as well, because I re-checked my two test entries [33 and 37] and both had had their tabs removed at some point. So it turns out that my original, replace(products_description, '\t', ' ') *did* work, I was just testing it on two rows that had multiple spaces in a row, but not tabs. But for the archives and future posts - the CHAR(9) worked as did the single quoted \t. Thanks for all your help, everyone. Much appreciated! /vjl/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: using replace() to remove tab chars
Try the following: REPLACE(products_description, CHAR(9), " ") Randall Price VT.SETI.IAD.MIG:Microsoft Implementation Group http://vtmig.vt.edu [EMAIL PROTECTED] -Original Message- From: Vince LaMonica [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 10:44 AM To: mysql@lists.mysql.com Subject: using replace() to remove tab chars Hi all, I am trying to use the replace() function in MySQL 4.1.13a to find and remove tab characters. I'm not sure how to signify the tab char, however. I've tried, "\t" to no avail: update products_description set products_description = replace(`products_description`,"\t"," ") where products_id = "33"; Does anyone have any suggestions? The mysql server [and client] are running under Linux. The products_description field is a 'text' type. If there's further info you need, please let me know. Thanks in advance, /vjl/ -- Vince J. LaMonica Knowledge is knowing a street is one way. [EMAIL PROTECTED] <*> Wisdom is still looking in both directions. When there's nothing else to read: http://w3log.vjl.org/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: using replace() to remove tab chars
On Wed, 1 Mar 2006, Vince LaMonica wrote: } update products_description set products_description = } replace(`products_description`,'\t',' ') where products_id = "37"; [snip] I should have also stated that in the above example, both the table name and the column name are the same - that's not a typo. /vjl/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: using replace() to remove tab chars
On Wed, 1 Mar 2006 [EMAIL PROTECTED] wrote: } [snip] } Does anyone have any suggestions? The mysql server [and client] are } running under Linux. The products_description field is a 'text' type. If } } there's further info you need, please let me know. } [/snip] } } Are you using REPLACE(column_name, '\t', ' ') ? I thought I had put an example of the SQL syntax in my e.mail, but yes, I have tried it with both single and double quotes: update products_description set products_description = replace(`products_description`,"\t"," ") where products_id = "37"; and update products_description set products_description = replace(`products_description`,'\t',' ') where products_id = "37"; For right now, I am only doing this on one record, for testing, but when I get the syntax right, the where clause will be removed. Currently, mysql reports: Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0 regardless if I use single quotes or double quotes in the replace() call. Thanks for your quick reply! /vjl/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: using replace() to remove tab chars
[snip] Does anyone have any suggestions? The mysql server [and client] are running under Linux. The products_description field is a 'text' type. If there's further info you need, please let me know. [/snip] Are you using REPLACE(column_name, '\t', ' ') ? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]