Error using writetable - all columns get concatenated into a single one
Mostrar comentarios más antiguos
Hi all!
I experience difficulties when I try to write my table back to an Excel File.
It seems to write all columns into the first column and I have no idea why.
I've already searched the internet and haven't found any similar problem so maybe you can advise me.
writetable(new_table,'C:\Users\Heindl\something\somethingelse.xls');
% This is the error:
Error using writetable (line 142)
Unable to write to sheet 'Sheet1' in file 'C:\Users\Heindl\something\somethingelse.xls'. Disable sheet protection, disable workbook's Mark as Final option, and ensure input does not exceed cell capacity.
Error in write_in_something (line 159)
writetable(new_table,'C:\Users\Heindl\something\somethingelse.xls');
The table in Matlab is around 100 by 100 but after writing it becomes a single 100 by 1 column. I am not allowed to post the table since it contains restricted research data, I'm sorry.
I should add, that I have already deleted additional 'iscategorical.m' files, which sometimes seems to help others with kind of similar problems.
Matthias
4 comentarios
Guillaume
el 12 de Ag. de 2019
What you show is an error thrown by writetable, which would mean that nothing gets written. So it's not clear why you say that something gets written.
I have already deleted additional 'iscategorical.m' files
Hopefully, you haven't deleted matlab's own iscategorical.m. If you have, I'm afraid you'll have to reinstall. Do not mess with matlab own files.
Matthias Heindl
el 13 de Ag. de 2019
Guillaume
el 13 de Ag. de 2019
Now, this is very confusing. How can a csv file (text file) have everything in one column?
In any case, best way for us to understand the problem is:
- a mat file containing the table (or a short version of it) you want to write
- the exact code you use to write it to a file.
With regards to the toolbox, you may be better off uninstalling it completely since it's probably broken without its own iscategorical.
Jonathan Havener
el 31 de Ag. de 2021
I was having this issue as well. All columns were concatenated to a single column. Odly enough, if I only wrote certain subsections of the table to csv it worked fine. 7:1000 worked, but 6:1000 didn't work. 1:10 worked fine. I thought maybe it was a size of data, but could never find a discernable pattern. 7:2000 was fine as well.
Respuestas (0)
Categorías
Más información sobre Data Import from MATLAB en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!