Main Content

La traduzione di questa pagina non è aggiornata. Fai clic qui per vedere l'ultima versione in inglese.

File di testo

File di testo delimitati e formattati

Leggere e scrivere dati numerici e non numerici in file di testo delimitati e formattati, compresi i file .csv and .txt.

App

Import ToolImport data from file

Attività di Live Editor

Importazione dei datiImport data from a file in the Live Editor (Da R2023a)

Funzioni

espandi tutto

Importazione ed esportazione di base

readtableCreate table from file
writetableWrite table to file
readtimetableCreate timetable from file
writetimetableWrite timetable to file

Definizione delle regole di importazione

detectImportOptionsCreate import options based on file content
delimitedTextImportOptionsImport options object for delimited text
fixedWidthImportOptionsImport options object for fixed-width text files
xmlImportOptionsImport options object for XML files (Da R2021a)
htmlImportOptionsImport options object for HTML files (Da R2021b)
wordDocumentImportOptionsImport options object for Microsoft Word document files (Da R2021b)
getvaroptsGet variable import options
setvaroptsSet variable import options
setvartypeSet variable data types
previewPreview eight rows from file using import options
readmatrixRead matrix from file
writematrixWrite a matrix to a file
readcellCreate cell array from file
writecellWrite cell array to file
readvarsRead variables from file
textscanRead formatted data from text file or string
typeDisplay contents of file
filereadRead contents of file as text
readlinesRead lines of file as string array (Da R2020b)
writelinesWrite text to file (Da R2022a)

Oggetti

tabularTextDatastoreDatastore for tabular text files

Argomenti

Lettura di dati tabellari da file di testo

Scrittura di dati tabellari da file di testo

  • Write Data to Text Files
    Export tabular data contained in tables, cell arrays, or numeric arrays from the MATLAB workspace to text files.