readtimetable does not read the entire Excel file
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Per Westerlund
am 17 Nov. 2023
Kommentiert: Per Westerlund
am 17 Nov. 2023
I have several Excel files with date and time and then some ten columns. The number of lines is 9000.
When I read them with readtimetable, I get them correct in six cases. The other four get cut at line 2881, 4345, 745 and 745 respectively. The first problematic one had dashes instead of the values in a column from the point that it did not work. I put 0 there and still it does not work.
What more can I try?
7 Kommentare
Akzeptierte Antwort
Drew
am 17 Nov. 2023
Bearbeitet: Drew
am 17 Nov. 2023
Your .xls file has a hidden worksheet before the visible worksheet. The hidden worksheet has fewer rows. By default, readtable is reading the first worksheet, which happens to be hidden. You can specify the worksheet name to read the visible worksheet you are looking for, and the result has 2992 rows as expected.
f2017t = readtimetable("n_fot2017-01-12 mod del.xls","Sheet","Förb + prod i Sverige", "VariableNamingRule", "preserve")
If this answer helps you, please remember to accept the answer.
2 Kommentare
Cris LaPierre
am 17 Nov. 2023
That reminded me of this Answer: https://www.mathworks.com/matlabcentral/answers/2042557-error-while-reading-table#answer_1346387
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets 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!