Documentation

Text Files

Delimited and formatted text files

Read and write numeric and nonnumeric data in delimited and formatted text files, including .csv and .txt files. Import text file data interactively using the Import Tool. Import or export text data programmatically using the functions on this page. To compare primary import options for text files, see Ways to Import Text Files.

Functions

csvread Read comma-separated value (CSV) file
csvwrite Write comma-separated value file
dlmread Read ASCII-delimited file of numeric data into matrix
dlmwrite Write matrix to ASCII-delimited file
textscan Read formatted data from text file or string
readtable Create table from file
writetable Write table to file
type Display contents of file
Was this topic helpful?