Link to home
Start Free TrialLog in
Avatar of Nura111
Nura111

asked on

How can I Convert from excel.access/csv(deliemted) to mysql format ?

Hi , Im trying to find a Canadian Postal code db that will contain the basix info+lat and lon and population I couldnt fins it so far in an myswl format
I found it in http://www.zip-codes.com/canadian-postal-code-database.asp
Its say its in Multiple data formats - Excel, Access, CSV (comma delimited)
Can I convert it to mysql format file?

Thank you!
Avatar of NotLogical
NotLogical
Flag of Canada image

Yes, you can easily do this using the mysqlimport utility.

You will need to ensure that you database structure is setup before you import, and correctly maps to the data you are importing.
Avatar of Nura111
Nura111

ASKER

Can you please give me more info about it:
how do I do it?
<<You will need to ensure that you database structure is setup before you import

<<correctly maps to the data you are importing.
ASKER CERTIFIED SOLUTION
Avatar of PranjalShah
PranjalShah
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Import the data into an Access database and then use the following Bullzip's MS Access to MySQL.

http://www.bullzip.com/products/a2m/info.php
@sscal - thanks for the pointer to BullZip - that's a fantastic utility! For a lot tasks, it can certainly save tons of time.

@Nura111: if you are comfortable with using BullZip, it's a good way to go. I briefly looked at the data description, and it would take no time to import it from either a CSV or MDB.

I am not sure how you are planning to use the data, but you will certainly want to create a few indexes to speed queries.

Please let me know if you need further help.
Avatar of Nura111

ASKER

<<Import the data into an Access database
I dont have an access database you mean as an access file.
The data need to be as a normal table in the db which Ill probably will need to add indexes is there anything else I need to take into consideration?
Im still thinking of what do to cause I might have a diffrent source I cant take the table from and it will be in a text format
An Access file is basically a database (it groups together tables, indexes, code modules, etc). So, @sscal was basically saying that since you can download a MDB file from the website you indicated, it is a very convenient source for the data when using the BullZip tool.

If you source your data as a CSV, you will then need to use mysqlimport. The Technical Specs tab on the zip-codes.com website gives you the format of the tables, if you need to create them by hand.
@Nuraa111

I am not sure why you dont want to use LOAD DATA INFILE. In the link I have posted it shows you how you can import a csv (or for that matter any delimiter) file to mysql table.
Avatar of Nura111

ASKER

Its not that I dont want ot Its just that at end I might use a diffrent  db So im gonna try ot soon
You question title says "... to mysql format"! If you are planning to use different database then decide for that first and then post the question
Avatar of Nura111

ASKER

I dont plan to use a diffrent db!! I dont know If im going to use that sourch for the data yet Im thinking of what to do now and than I will use your advise when ill decide.
you can take a look at https://www.experts-exchange.com/questions/27438110/Im-trying-to-download-the-canada-postal-code-info-from-http-www-geonames-org-anyone-uset-it-before.html?cid=239&anchorAnswerId=37105257#a37105257

Thats my problem now that's why im stuck
Thank you.

From what I can see, and I compared two random points:

>> Burnt Point, NL
5912047      Burnt Point      Burnt Point            46.1834      -62.49864      P      PPLL      CA            09                        0            -9999      America/Halifax      2006-01-18
5912041      Burnt Point      Burnt Point            47.96659      -53.03136      T      PT      CA            05                        0            -9999      America/St_Johns      2006-01-18

A0A 1M0,BURNT POINT BDV,NL,709,47.953129,-53.043975

>> Wabush, NL
6174844      Wabush      Wabush            52.90015      -66.86541      P      PPL      CA            05                        0            603      America/Goose_Bay      2008-04-11

A0R 1B0,WABUSH,NL,709,52.904764,-66.870789

First of all, you are only interested in the PPL records - so you can prune back a whole huge swath of the data. Second of all, the postal records generally cover and describe a number of delivery areas, so you could perform a search around some type of centroid, or if you want to keep things simple, allow a variation of +/- some degree of long/lat for the inclusion area.

I had toyed around with this type of data a few years ago, so I know the pain you are going through.
Avatar of Nura111

ASKER

what is the  PPL records please?

<<so you could perform a search around some type of centroid, or if you want to keep things simple, allow a variation of +/- some degree of long/lat for the inclusion area.

Sorry didn't understood what it mean..
I think we're heading off the path of the original question that was asked here.

I can only recommend that you read the data definition for the sources you identify here, and in your other question (27438110).

You will see that the records in the geonames.org data set are identified by their meaning, and that they convey different information. By correlating these records with the postal codes, you will be able to extract the information you are looking for.
Avatar of Nura111

ASKER

So could you try answer it in the other question I dont understand how to add the population to the postal code table I can also open a new question if u like
Avatar of Nura111

ASKER

<<convey different information. By correlating these records with the postal codes, you will be able to extract the information you are looking for.
can you  explain what exactly you mean and How can I use it to add the population to the zip code?

Thank you