MAC: Write numberical dataset with string header row to .csv
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I know this has topic has been broached in the PC world, so I apologize if this has been successfully addressed for MAC. I have seen a few convoluted options, though I have been unsuccessful in getting them functional for me.
I am attempting to write a dataset to a .csv file. This is a numeric matrix with a string header. I have made various attempts with csvwrite, dlmwrite, export, etc. I understand there are issues with MAC contacting Excel, but I wonder if there is a simple, elegant work around for this issue? Perhaps something I am missing?
Sorry, I know this is woe-fully rudimentary.
0 comentarios
Respuestas (1)
Walter Roberson
el 11 de Jun. de 2016
fopen() the output file and fprintf() the header into it. After that you have two choices:
1) continue onwards by using fprintf() to write out the numeric part, and then fclose() the file; or
2) fclose the file, and then use dlmwrite() with the append option to write the numeric part.
0 comentarios
Ver también
Categorías
Más información sobre Text Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!