<< readxls2bd Basic functions repmat >>

grocer >> Basic functions > readxlsx

readxlsx

Reads an Excel file

CALLING SEQUENCE

S = readxlsx(filename,sheet)

PARAMETERS

Input

* filename = a string, the name of the Excel file

* sheet = a string or a number, indicating the sheet to select in the Excel file

Output

* S = a mlist file ot type xls with fields 'name', 'text' and 'value'

DESCRIPTION

r Reads xls or xlsx files into Scilab.

EXAMPLE

global GROCERDIR ;
// read the CPB World Trade monitor for June 2020 (downloaded from the CPB website) 
// available in Grocer data folder
S=readxlsx(GROCERDIR+'\data\CPB-World-Trade-Monitor-June-2020.xlsx');
// recover the content of the first sheet of the xlxs file
S1=S.sheets(1);
// recover the text cells
S1_txt=S1.text;
// recover the value cells
S1_val=S1.value;
// read only the inpro_out sheet
S=readxlsx(GROCERDIR+'\data\CPB-World-Trade-Monitor-June-2020.xlsx','inpro_out');
// which can be done also as follows
S=readxlsx(GROCERDIR+'\data\CPB-World-Trade-Monitor-June-2020.xlsx',2)

AUTHOR

Éric Dubois 2021

Report an issue
<< readxls2bd Basic functions repmat >>