HOW CAN A .DAT FILE BE EDITED

6 vues (au cours des 30 derniers jours)
Ahmed Abed
Ahmed Abed le 8 Juin 2017
Commenté : Ahmed Abed le 9 Juin 2017
Hi; I trying to change a certain number in a DAT file, the file consists of numbers and text as shown
The problem is every time I edit the file using commands like fprintf to overwrite the file, the external programme that supposes the read and executes the file gives me an error because it is not able to read the file anymore. please, is there a way to edit and save the file while it is still readable? Thanks
  12 commentaires
Jan
Jan le 9 Juin 2017
Modifié(e) : Jan le 9 Juin 2017
As we see in this screenshot, you try to attach a .rar file. The error message tells clearly, that this is not supported, but a .zip file would work and .txt files also.
Nevertheless, your problem is solved and attaching the file is not needed anymore.
Instead of using 'wt' in fopen, you can replace the line breaks also by '\r\n'. Beside the Editor shipped with Windows, your application seems to require the DOS linebreaks. What a pitty.
Ahmed Abed
Ahmed Abed le 9 Juin 2017
Sorry, I did not notice that, the file is uploaded now. Yes, the problem is solved and thanks for your support!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by