[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
www.undertowsoftware.com • View topic - Excel info to MapOCX 80 Pro

Excel info to MapOCX 80 Pro

A forum made available for users of the MapPro OCX SDK to exchange ideas, ask each other questions, etc.

Excel info to MapOCX 80 Pro

Postby MarkY » Sun Mar 06, 2011 12:42 am

I have an excel file that contains info I want to display on the map, using MapOCX 80 Pro. The excel file has about 500 records with address info customer name, delivery code, etc. and I want to find an easy way to load and display that info. If someone has a snippet of code, I don;t care what language it's in, I can convert it. I would appreciate any help.

Thanks,
Mark
The gene pool has no lifeguard...
User avatar
MarkY
Active User
Active User
 
Posts: 28
Joined: Sat Feb 06, 2010 7:31 pm

Re: Excel info to MapOCX 80 Pro

Postby SamDee » Sun Mar 06, 2011 11:13 am

There are lots of places where you can find sample code on how to parse CSV files, in different languages. The best way may be to use the MS Jet driver. Here is a link with some good C# code on how to do that (There are many other sources - google it)

http://knab.ws/blog/index.php?/archives ... art-1.html
User avatar
SamDee
Active User
Active User
 
Posts: 35
Joined: Wed Sep 29, 2010 8:33 am

Re: Excel info to MapOCX 80 Pro

Postby Kevin_T » Sun Mar 06, 2011 11:40 am

Samdee, I was going to suggest a simple approach, like using the split function, but that would not have worked for records with commas embedded in the fields. The approach in your link is a much more generalized and proper approach!
User avatar
Kevin_T
Senior User
Senior User
 
Posts: 265
Joined: Fri Apr 30, 2010 9:13 am

Re: Excel info to MapOCX 80 Pro

Postby SamDee » Mon Apr 04, 2011 8:33 am

You are right, it would choke on CSV files with commas in the fields, but there are other means of importing the data, without having to worry about embedded commas, if you use an SQL import method. Or, one could write their own parser, it's not really all that difficult and it's tedious, but why waste the time if there ready-made ways to do that.
User avatar
SamDee
Active User
Active User
 
Posts: 35
Joined: Wed Sep 29, 2010 8:33 am


Return to MapPro OCX

Who is online

Users browsing this forum: No registered users and 1 guest

cron