PDA

View Full Version : New to MYSQL - Question


RHINO111
3-28-06, 09:36 AM
I'm using Unicode letters, english, and numerals for my data. There are 5 Columns of information with a few thousand rows. The layout is:

Unicode, Numerals, Text, Text, Numerals

When some one searches for an english word on my web page I want the Unicode information along with the entire row it shares. Seems simple enough.

It's currently in an Excel sheet. I saved it as a "text" file with Tabs not commas. The .txt is saved as utf-8 format to support the unicode letters.

When i try to import this text file into the "powweb mysql" section it spits out all kinds of syntax errors among other things. What are the rules for my data to be read properly in the .txt format?

So do I need CSV, Tabs, etc... What are the no no's for data to be imported correctly. I am not a programmer so please in easy to understand terms.

Thanks for any help

RHINO111
3-28-06, 10:52 PM
Got it never mind. I finally overcame the cluncky tools they provide.


One more question - I have my data in excel. How can I save that data to a ".txt" format so it uses "csv" and not tabs. Also I need the encoding of the ".txt" save to be set to "UTF-8".

That seems to be the hard part. If you export without that setting you lose unicode letters in the .txt file.


Any1 .... any1?

RHINO111
3-29-06, 02:06 PM
I Figured out a work around. So here you go for anyone else who should ever need this for mysql data base .txt files.

Copy paste your data from Excel to .txt file (or use Unicode export .txt)

Then Use the "Replace" feature - I simply copied a "tab area" and pasted that into the "replace" and then put "," in the replace with and ran it on all.


Now you have a useable "csv" and then you can "save as" into the "UTF-8" encoding.

Might be handy to anyone else who is using Unicode and other variables in their databases.

IanS
3-29-06, 02:45 PM
You can also do it the easy way and use FIle/Save as/ then change the file type to CSV (Ms-dos) and select your own delimiter.

RHINO111
3-29-06, 02:58 PM
I get Unicode error with that. The excel data has unicode letters so doing it your suggested method returns errors.

IanS
3-29-06, 03:39 PM
I don't have data with Unicode letters so can't test this.

RHINO111
3-29-06, 04:08 PM
Δαμασκος
Δανειζω
Δανειον
Δανειστης
Δανιηλ
Δαπαναω
Δαπανη


Here's some for you

IanS
3-30-06, 04:17 AM
The version of excel I'm using has a save has an "Unicode" option - this is tab delimited.
I'm using Excel 2003. This should work for you.

Having read your original problem again, it is probably a setting in MySql that needs altering and not the file you save as you've managed to save the file with Unicode characters. Sorry to have led you off in the wrong direction.