How to add data to an existing txt file which already contains some lines ?

25 vues (au cours des 30 derniers jours)
How to add data to an existing txt file which already contains some lines ?

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 6 Août 2015
a=[1 2 3;4 5 6]
dlmwrite('file.txt',a,'-append','newline','pc')

Plus de réponses (1)

Stephen23
Stephen23 le 6 Août 2015
Modifié(e) : Stephen23 le 6 Août 2015
Read the fopen documentation and have a look at the permission options. You will find the permission 'a' or 'a+' of particular interest.
You can use fprintf to print text to file, or one of the other text-file writing functions.

Catégories

En savoir plus sur Low-Level File I/O dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by