Read data from CSV files
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I would like to read data from a CSV file between column A and column K such that those columns contains numbers only. In that file, column L is not number but alphabets. When I use the function "csvread" it gives the following error message:
Mismatch between file and format string. Trouble reading number from file (row 1, field 12) ==> F, 0
I am wondering how can I read the data from that CSV file?
By the way, I am using Matlab R2006a.
Thanks,
Alan
2 Kommentare
Antworten (1)
Chirag Gupta
am 29 Apr. 2011
Try using textscan to read your data.
Typical usage:
fid = fopen(filename,'w');
data = textscan(fid,'%g %g %g %g %g %g %g %g %g %g %g %*s','delimiter',',');
fclose(fid);
Siehe auch
Kategorien
Mehr zu Large Files and Big Data 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!