Skip to content

readtable

Read tabular data from a file into a table.

T = readtable(filename)
T = readtable(filename, opts)
T = readtable(filename, 'Name', value, ...)

Reads delimited text files (.csv, .txt, .tsv), Excel files (.xls, .xlsx), and other tabular formats and returns the contents as a table. Options control delimiters, header rows, encoding, and column types.

T = readtable('data.csv')
T = readtable('data.txt', 'Delimiter', '|')
  • table — Create a table — a heterogeneous tabular data container.
  • csvread — Read a CSV file into a matrix.