Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.1 - English

Change language to:
Français - 日本語 - Português

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Spreadsheet > xls_read


read a sheet in an Excel file

Calling Sequence

[Value,TextInd] = xls_read(fd,Sheetpos)



a number, the logical unit on the Excel stream returned by xls_open.


a number: the position of the beginning of the sheet in the Excel stream. This position is one of those returned by xls_open.


a matrix of numbers, the numerical data found in the sheet. The cell without numerical data are represented by NaN values.


a matrix of indices with the same size as Value. The 0 indices indicates that no string exists in the correspondin Excel cell. a positive index i points to the string SST(i) where SST is given by xls_open.


This function reads an Excel sheet given a logical unit on an Excel stream ant 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.

Warning only BIFF8 Excel files (last Excel file version) 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

See Also

  • xls_open — Open an Excel file for reading
  • readxls — reads an Excel file


Pierrick Mode


Serge Steer



This function is based on Excel stream description from OpenOffice (

Used Functions

This function uses the xls.c file which can be found in a Scilab source version in the directory SCIDIR/modules/spreadsheet/src/c

<< xls_open Spreadsheet Shell >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Mar 03 10:59:46 CET 2011