How to write string array into csv file?
조회 수: 26 (최근 30일)
이전 댓글 표시
I have two string array and I have to write them as first row i.e A and second one in B how to write it?
two string array are as follows;
nameHeaders = {'Heat No','Grade','Product','Batch No','Specification','Condition','Customer','From Shop','Route Card No','Route Card Date','PO/SO No','PO/SO Date'};
addData = [str2num(handles.edit_46) str2num(handles.edit_47) str2num(handles.edit_48) str2num(handles.edit_49) str2num(handles.edit_50) str2num(handles.edit_51) str2num(handles.edit_52) str2num(handles.edit_53) str2num(handles.edit_54) str2num(handles.edit_55) str2num(handles.edit_56) str2num(handles.edit_57)];
댓글 수: 0
답변 (1개)
Florian Bendl
2016년 3월 1일
The solution requires some fiddling around with basic function such as fprint, etc. Luckily though, there are some really nice solutions on the file exchange. Not sure at the moment which one I am using. Here some links:
http://www.mathworks.com/matlabcentral/fileexchange/7601-cell2csv http://www.mathworks.com/matlabcentral/fileexchange/4400-cell-array-to-csv-file--cell2csv-m- http://www.mathworks.com/matlabcentral/fileexchange/7601-cell2csv
Just put your Output including headers etc. in a cell array (each entry in one cell) and then run the function to generate the csv file.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!