How to convert .txt file to .dat?

54 visualizaciones (últimos 30 días)
Nooshdokht Bayatafshary
Nooshdokht Bayatafshary el 19 de Sept. de 2018
Editada: Stephen23 el 19 de Sept. de 2018
I created a text file in matlab and wrote my data on it. Now I need to convert this text file to .dat. How should I do this?
  3 comentarios
Nooshdokht Bayatafshary
Nooshdokht Bayatafshary el 19 de Sept. de 2018
I want use that in Ubuntu. It will be my inputs for modeling. I can change the format with command window ('ren *txt *dat'), but I want change it with matlab.
Stephen23
Stephen23 el 19 de Sept. de 2018
Editada: Stephen23 el 19 de Sept. de 2018
"I can change the format with command window ('ren *txt *dat')..."
That command does not change the file format in any way whatsoever, it just changes the file extension. Changing the file extension is easy with MATLAB: movefile.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 19 de Sept. de 2018
You can call movefile() if all you need is to change the file extension.
You can probably just change the code to open a .dat for writing instead of .txt but that depends on how the code creates the file.

Categorías

Más información sobre Low-Level File I/O en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by