Page 1 of 1
Reading data from Excel?
Posted: Tue Jul 19, 2016 10:10 pm
by dmgaba
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
Re: Reading data from Excel?
Posted: Wed Jul 20, 2016 12:20 am
by PGilbert
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.
Re: Reading data from Excel?
Posted: Wed Jul 20, 2016 1:37 pm
by AndyS|Dyalog
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.
Re: Reading data from Excel?
Posted: Wed Jul 20, 2016 8:44 pm
by dmgaba
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....
Re: Reading data from Excel?
Posted: Thu Jul 21, 2016 12:25 am
by PGilbert
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.
Re: Reading data from Excel?
Posted: Thu Jul 21, 2016 7:20 am
by Morten|Dyalog
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