Page 1 of 1

Importing From Excel

Posted: November 24th, 2015, 3:44 am
by boikgwadi
Is there any way that the language can import data from Excel?

Re: Importing From Excel

Posted: November 24th, 2015, 10:36 am
by josh
There is no command for Excel import in the language. You can use the Excel2CSPro tool to convert your Excel spreadsheet to CSPro format and then access the data from your program logic as an external data file. This is the route I would take.

Others have exported from Excel to csv format and then use fileread in the logic to parse the csv file. Another wrote a VB program to extract from the Excel and write to a text file. He launched the VB program using execsystem and then parsed the text file using fileread. Both of these solutions require quite a bit of skill in programming.

Re: Importing From Excel

Posted: December 14th, 2015, 1:57 pm
by reeve
Any chance that CSPro will move beyond its record and column location format? That would be my top priority for a new revision. It seems like 20th century technology; about half of my wasted time is getting the correct column locations in the data dictionary.

Re: Importing From Excel

Posted: December 14th, 2015, 4:54 pm
by josh
Yes, dealing with column start positions and lengths is a real pain. This dates back to the days when saving one or two characters per record on a big survey or census meant being able to fit the data file on a disk or not. These days it is just an annoyance. This is on our todo list but doing in such a way that maintains compatibility with old data files will require a lot of work so we will be doing it in small steps.

In the meantime Greg is working on an improved version of CSPro2Excel that will create the dictionary from the Excel file so you don't need to deal with column positions and lengths when converting from Excel to CSPro data files. I'll post here when that is ready.

Re: Importing From Excel

Posted: December 15th, 2015, 8:34 pm
by reeve
Neat!