MAC: Write numberical dataset with string header row to .csv
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Walter Roberson
on 11 Jun 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 Comments
See Also
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!