La traduction de cette page n'est pas à jour. Cliquez ici pour voir la dernière version en anglais.
Fichiers texte
Fichiers de textes délimités et formatés
Lisez et écrivez des données numériques et non numériques dans des fichiers texte délimités et formatés, y compris des fichiers .csv
et .txt
.
Applications
Import Tool | Import data from file |
Tâches du Live Editor
Import Data | Import data from a file in the Live Editor (depuis R2023a) |
Fonctions
Objets
tabularTextDatastore | Datastore for tabular text files |
Rubriques
Lire des données tabulaires à partir de fichiers texte
- Import Text Files
MATLAB® can read and write numeric and nonnumeric data from delimited and formatted text files, including.csv
and.txt
files. - Read Text File Data Using Import Tool
Preview tabular data from a text file or the clipboard and select data to import using the Import tool. - Import Data from Text File to Table
The best way to represent tabular data from text files in MATLAB is in a table since tables can store heterogeneous (a mix of numeric and text) data, as well as variable and row names. - Control How MATLAB Imports Your Data
If you want to control the import process beyond the options provided by thereadtable
function, such as defining how to handle missing data or errors, then create an import options object before importing the data. - Import Block of Mixed Data from Text File into Table or Cell Array
Import block formatted tabular data from a text file into a table or a cell array. - Import Numeric Data from Text Files into Matrix
In addition to importing numeric tabular data from a text file as a table usingreadtable
, you can also import this data as a matrix into the MATLAB workspace. - Import Block of Numeric Data from Text File
Read arbitrary block-formatted numeric data from a text file into cell arrays. - Read and Analyze Large Tabular Text File
This example shows how to create a datastore for a large text file containing tabular data, and then read and process the data one block at a time or one file at a time. - Import Dates and Times from Text Files
Import formatted dates and times (such as'01/01/01'
or'12:30:45'
) from column oriented tabular data. - Read Collection or Sequence of Text Files
Read and manage data from a collection of text files.
Écrire des données tabulaires dans des fichiers texte
- Write Data to Text Files
Export tabular data contained in tables, cell arrays, or numeric arrays from the MATLAB workspace to text files.