sheetnames - Get sheet names from spreadsheet file - MATLAB (original) (raw)

Main Content

Get sheet names from spreadsheet file

Syntax

Description

`sheets` = sheetnames([filename](#mw%5F9b350553-1c36-476a-8f56-0747094485df)) returns a string array of sheet names from the specified spreadsheet file.

example

Examples

collapse all

Get the name of all worksheets from the spreadsheet file airlinesmall_subset.xlsx.

sheets = sheetnames('airlinesmall_subset.xlsx')

sheets = 13×1 string "1996" "1997" "1998" "1999" "2000" "2001" "2002" "2003" "2004" "2005" "2006" "2007" "2008"

Input Arguments

collapse all

Name of the file to read, specified as a character vector or a string scalar.

Depending on the location of your file, filename can take one of these forms.

Location Form
Current folder or folder on the MATLAB® path Name of the file.Example: 'myFile.xls'
Other local folder Full or relative path to the file.Example: 'C:\myFolder\myFile.xlsx'Example: 'myDir\myFile.xlsx'
Remote Location Full path to the file, specified as a uniform resource locator (URL) of the form:scheme_name://path_to_file/_my_file.ext_Based on the remote location,scheme_name can be one of the values in this table. Remote Location_scheme_name_Amazon S3™s3Windows Azure® Blob Storagewasb, wasbsHDFS™hdfsFor more information, see Work with Remote Data.Example: 's3://bucketname/path_to_file/my_file.xlsx'

Data Types: char | string

Version History

Introduced in R2019b