Comma Separated Imported Data
Mostrar comentarios más antiguos
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).
Respuesta aceptada
Más respuestas (1)
Jan
el 13 de Jun. de 2018
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 comentarios
Cameron Power
el 13 de Jun. de 2018
Walter Roberson
el 13 de Jun. de 2018
... That is the implementation, other than the fact that you would proceed from there to
T = readtable(FileName);
Categorías
Más información sobre Text Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!