reads a sheet in an Excel file
[Value,TextInd] = xls_read(fd,Sheetpos)
fd a number: | the logical unit on the Excel stream returned by xls_open. |
---|
:
This function reads an Excel sheet given a logical unit on an Excel stream and the position of the beginning of the sheet within this stream. It returns the numerical data and the strings contained by the Excel cells.
The readxls function can be used to read all an Excel file in one function with a single function call.
Only BIFF8 Excel files (last Excel file version (2003)) are handled.
//Decode ole file, extract and open Excel stream
[fd,SST,Sheetnames,Sheetpos] = `xls_open`_('SCI/modules/spreadsheet/demos/xls/Test1.xls')
//Read first data sheet
[Value,TextInd] = xls_read(fd,Sheetpos(1))
//close the spreadsheet stream
`mclose`_(fd)
This function is based on Excel stream description from OpenOffice (http://sc.openoffice.org/spreadsheetfileformat.pdf).
This function uses the xls.c file which can be found in a Scilab source version in the directory SCIDIR/modules/spreadsheet/src/c.