Comma Separated Imported Data
显示 更早的评论
I have a csv file that is separated by commas without spaces and with will not be separated into multiple variables. Is there something I can do in Matlab? I tried tooling with the delimiter options but to no evail, thank you (I have attached one of the files).
采纳的回答
更多回答(1 个)
Jan
2018-6-13
Remove the double quotes at first:
S = fileread(FileName);
S(S == '"') = [];
fid = fopen(FileName, 'w');
fwrite(fid, S, 'char');
fclose(fid);
Then the standard tools should word: readtable, csvread, sscanf, textscan.
2 个评论
Cameron Power
2018-6-13
Walter Roberson
2018-6-13
... That is the implementation, other than the fact that you would proceed from there to
T = readtable(FileName);
类别
在 帮助中心 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!