How to export a number of strings in a csv file
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Saugata Bose
am 6 Nov. 2018
Kommentiert: b
am 3 Dez. 2020
Hello I am working on text analytics in matlabR2017b. Currently, I have a 25 data in csv format. After some preprocessing on these data, I have generated tokenizedDocument data.
cleanData=preprocess(textData);
disp(class(cleanData));% cleanData is tokenizedDocument type
Now I would like to export these data in a csv file along with the length of each document.I have read few posts regarding these exporting and I did not found any relevant post to export tokenizedDocument data to csv file. So I have tried to explore the opportunities of dlmwrite/csvwrite in my program. I have tried these as folloing:
cD=joinWords(cleanData);%to convert from tokenizedDocument to string
Now, would you please suggest me how to export these data along with the length of each string to a csv file?
Thanks,
3 Kommentare
Akzeptierte Antwort
madhan ravi
am 6 Nov. 2018
Bearbeitet: madhan ravi
am 6 Nov. 2018
c=char({'hi','there'})
dlmwrite('c.csv',c,'delimiter','')
dlmwrite just writes each cell with a new line
5 Kommentare
b
am 3 Dez. 2020
This puts the first string 'hi' in A1, and the second string 'there' in A2 (in excel notations, when this csv file is opened in excel).
How to put the first string in A1, and the second string in B1 (instead of A2)?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!