onyourmark
asked on
excel as database
Hi. I have asked a programmer to try to implement these javascript graphs http://www.highcharts.com.
They would generally access a database like mysql but I have files, csv files, which I want to access. The programmer does not know how to handle that. I think it is possible. Can anyone suggest a strategy for doing this?
Thanks.
They would generally access a database like mysql but I have files, csv files, which I want to access. The programmer does not know how to handle that. I think it is possible. Can anyone suggest a strategy for doing this?
Thanks.
ASKER
Can you say how to load it as a 2 dimensional array. I think there is a way to have the graphing application treat it just like it is a database. It used to be to use something like an odbc driver or something like that but I don't know now. The fields are all comma delimited and although it has text the text is quoted.
There is an odbc driver for text databases, just like there's one for excel files. I'm not sure how they work though, as I've never used them.
Loading a text file into an array is easy: Just open the text file and load one line to a variable. Then break it on each separator (, or ; or whatever it's defined) and assign to the array. Then just loop for all the lines.
You can then use, if you want, an odbc connection to an existing database and dump it into a temp table, or even store it permanently in an existing one. That way, you can work the data with SQL queries, which you couldn't do if you work with just the array.
Loading a text file into an array is easy: Just open the text file and load one line to a variable. Then break it on each separator (, or ; or whatever it's defined) and assign to the array. Then just loop for all the lines.
You can then use, if you want, an odbc connection to an existing database and dump it into a temp table, or even store it permanently in an existing one. That way, you can work the data with SQL queries, which you couldn't do if you work with just the array.
You can use an excel table like a database. Read it, and use it directly. Exactly why does the programmer think he can't use the excel spread sheet?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here's a second example from the codeproject, a good site for any programmer:
http://www.codeproject.com/KB/grid/Excel_in_CS.aspx
http://www.codeproject.com/KB/grid/Excel_in_CS.aspx
ASKER
Hi. Thank you. They seem like good links.
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
If they're consistent (for example, each line has 5 "fields", separated by a comma, and no field has a comma in it ever, though there are ways to include one as well) all he has to do is load them to a 2 dimensional array. A 2 dimensional array can then be treated in a similar way as a table. You can even send it to a temporary table and work it like that.