readtable working differently for different files
Mostrar comentarios más antiguos
I have a bunch of spreadsheets which all have the same format. However, when I read them in, they appear differently...
folder=('H:\SoundTrap\Boats\Manual Vessel Detections');
d=dir(fullfile(folder,'*.csv'));
site=('Goat');
for i=1:height(d)
idx=contains(d(i).name,site);
if idx==1
out{i}=readtable(fullfile(folder,d(i).name));
end
end

For some reason, one of the files is read using a different delimeter? So the columns are incorrectly split. How can I rectify this? I have tried detect import options and 'Format' '%s%s%s' to no avail. Perhaps I am using these incorrectly though. The desired format is the one below:

3 comentarios
Mathieu NOE
el 8 de Jun. de 2021
hello Louise
can you share the problematic spreadsheet file as well ? and maybe one that works fine too
tx
Stephen23
el 8 de Jun. de 2021
@Louise Wilson: please upload two or more sample flles (ones which import differently) by clicking the paperclip button.
Louise Wilson
el 8 de Jun. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Spreadsheets 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!