Importing From Excel

What would you like to see in CSPro?
Forum rules
New release: CSPro 8.0
Post Reply
boikgwadi
Posts: 26
Joined: June 27th, 2014, 2:47 am

Importing From Excel

Post by boikgwadi »

Is there any way that the language can import data from Excel?
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Importing From Excel

Post 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.
reeve
Posts: 17
Joined: July 29th, 2015, 9:55 am
Location: Washington, DC

Re: Importing From Excel

Post 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.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Importing From Excel

Post 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.
reeve
Posts: 17
Joined: July 29th, 2015, 9:55 am
Location: Washington, DC

Re: Importing From Excel

Post by reeve »

Neat!
Post Reply