Reading data from Excel?

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...

Reading data from Excel?

Postby dmgaba on Tue Jul 19, 2016 10:10 pm

Hi: I am new to Dyalog APL but not to APL itself. I am "migrating" from APLX.
APLX had quad functions to import data from comma delimited or tab delimited spreadsheet files (as well as from some other sources, including XML). I have looked at all the documentation, and if there are similar capabilities for Dyalog APL 15 I can't find it. My web search found a mention of some 3rd party applications that can be used in Dyalog (Syncfusion XLSIO or something) and SfExcel but I found nothing showing how to implement those.

SO.... how does one important data from Excel, whether the whole spreadsheet (or whole workbook) or just data values from specific cells, range, row or column?

And, can one write data back to either a newly created Excel sheet or to an existing one.

Thanks DG
dmgaba
 
Posts: 2
Joined: Mon Jul 18, 2016 7:14 pm

Re: Reading data from Excel?

Postby PGilbert on Wed Jul 20, 2016 12:20 am

Hello DG welcome to the Dyalog family. You can find information about using the Syncfusion XLSIO namespace in the APLWiki at Excel, for XML and for CSV and also CSV. Also if you do )load loaddata it will load the workspace \ws\loaddata.dws that is supplied with the interpreter that has some native function to deal with .CSV, XML and Excel file.
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: Reading data from Excel?

Postby AndyS|Dyalog on Wed Jul 20, 2016 1:37 pm

There's also the CsvToApl code on http://aplwiki.com.

If you're running on Windows, and your data is in Excel spreadsheets, I would suggest writing code based on LoadXL and Save XL in the loaddata workspace; the same techniques can also be applied to Powerpoint or Word. Rick Proctor and David Crossley did a workshop on Dyalog and Excel during Dyalog '11; their materials are available from links on http://www.dyalog.com/user-meetings/dyalog11.htm.
User avatar
AndyS|Dyalog
 
Posts: 257
Joined: Tue May 12, 2009 6:06 pm

Re: Reading data from Excel?

Postby dmgaba on Wed Jul 20, 2016 8:44 pm

Thanks for responding. Unfortunately, I wasn't specific enough -- I am a user of APL15 on a MAC, and when I loaded the ws with LoadXL and ran it it tells me that that function works in Windows only. Is that so? If so, are there any other options? Syncfusion XLsIO seems very expensive, especially since I could get by in APLX for the time being....
dmgaba
 
Posts: 2
Joined: Mon Jul 18, 2016 7:14 pm

Re: Reading data from Excel?

Postby PGilbert on Thu Jul 21, 2016 12:25 am

Hello DG, Syncfusion is included with Dyalog APL in directory ..\Syncfusion\4.5 so you don't need to pay for it. It is working with Windows only however.
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: Reading data from Excel?

Postby Morten|Dyalog on Thu Jul 21, 2016 7:20 am

Hi DG! For reading and writing delimited files, I suggest you take a look at the function LoadTEXT which you will find in the workspace "loaddata", which is distributed with the Mac version. If this doesn't work, please let me know and we'll take a look.

We are working on emulation of many APLX system functions, including ⎕IMPORT which I suspect you are using for reading these files in APLX(?). I hope to publish the first version of our emulations, and some thoughts about what to look for when migrating code, tomorrow (Friday July 22nd). We currently have (sometimes partial) emulations for the functions listed below, please let me know if anything important is missing (but don't hold your breath for ∆WI or ∆NI):

Code: Select all
 ∆AF           ∆DR           ∆L            ∆OV         
 ∆AI           ∆EA           ∆LIB          ∆R           
 ∆AV           ∆EM           ∆M            ∆SS         
 ∆B            ∆ERM          ∆N            ∆TIME       
 ∆BOX          ∆EXPORT       ∆NAPPEND      ∆VI         
 ∆C            ∆FI           ∆NERASE       ∆W           
 ∆CALL         ∆HOST         ∆NREAD        ∆a           
 ∆DBR          ∆I            ∆NREPLACE                 
 ∆DISPLAY      ∆IMPORT       ∆NWRITE
User avatar
Morten|Dyalog
 
Posts: 453
Joined: Tue Sep 09, 2008 3:52 pm


Return to New to Dyalog?

Who is online

Users browsing this forum: No registered users and 1 guest