Webyog Forums: Find Character In All Fields - Webyog Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Find Character In All Fields

#1 User is offline   andrewteg Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 13
  • Joined: 04-June 08

Posted 15 February 2010 - 03:51 PM

I'm looking for an easy way to find oddball characters and clean them up for a database. Basically we have a lot of pasted in data that includes data like â that should be a regular a and things of that nature.

I know it'd take a while but I'd like a way to identify all the occurrences of that in a table, a set of tables, or even an entire database if possible.

Is there a way to do that with MySQL or SQLyog or would I have to dump out the database data to a text file, search that, make a note of the table and row, and then go back into the live data at that end and fix it?

Thanks,
Andrew
0

#2 User is offline   peterlaursen Icon

  • Advanced Member
  • PipPipPip
  • Group: Admin
  • Posts: 6,551
  • Joined: 01-June 03
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 15 February 2010 - 04:55 PM

One thing you could try is to dump, 'search and replace' in an editor and import again.

However problems that may occur are:

1) dump may be too big for an editor (take one table at a time). I know that Ultraedit for instance handles very big files without being unacceptable slow.

2) if you have binary data (BLOBs) then

* such characters may occur in the textual display of such BLOB so here you should not 'search and replace' them of course.

* some editors may garble HEX patterns that are not valid UTF8.  With SQLyog Enterprise/Ultimate the 'scheduled backup' has an option to set the encoding of the dump. Make it latin1  (ANSI) for this special purpose - not utf8, as all HEX patterns are valid in ANSI.

* some editors may truncate long BLOB/TEXT/bulk inserts







-- so be careful - do not drop the original tables before you are sure that it is OK!  For instance you could 'duplicate table', next export-edit-import the duplicate. Now rename the original and rename the duplicate to the original name.


Computers make your grey hair come off ....

Peter Laursen
Webyog
0

#3 User is offline   peterlaursen Icon

  • Advanced Member
  • PipPipPip
  • Group: Admin
  • Posts: 6,551
  • Joined: 01-June 03
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 15 February 2010 - 05:07 PM

And besides I will move you to the SQLyog category!
Computers make your grey hair come off ....

Peter Laursen
Webyog
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users