Cannot read csv with readtable (Unrecognized field name "text")

조회 수: 40 (최근 30일)
Min
Min 2025년 1월 20일
댓글: Min 2025년 8월 12일
Hi All,
I'm trying to read some csv data but saw the following error, for which I had absolutely no clue... Could anyone kindly help?
aaa.csv is just a simple dummy dataset I created with excel for the sake of testing.
Error from matlab:
aaa = readtable('G:\My Drive\Project_GDrive\data\aaa.csv');
Error using readtable (line 517)
Unrecognized field name "text".
Many thanks
Min
  댓글 수: 12
Walter Roberson
Walter Roberson 2025년 1월 21일
I would suggest
dbstop if caught error
and then run the code. It should stop at the place the error actually occurs. It is quite unlikely that it is stopping at
which readtable
/MATLAB/toolbox/matlab/iofun/readtable.m
line 517, as that readtable has no-where near 517 lines.
Walter Roberson
Walter Roberson 2025년 8월 12일
Ah, in R2024a, readtable.m line 517 contains a throw() for an exception that was taken in another function. Tracking the problem is a bit more of a nuisance, but
dbstop if caught error
would help

댓글을 달려면 로그인하십시오.

답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2025년 1월 20일
You mistyped the file name. It is read correctly - see:
D = readtable('aaa.csv');
disp(D)
srgae regse esgrse dgfc _____ _____ ______ __________ 1 2 3 {'sredgr'} 5 64 353 {'fggd' } 242 353 32 {'fgwt' } 64 56 465 {'xg' } 3 324 4245 {'wwet' }
  댓글 수: 4
Image Analyst
Image Analyst 2025년 8월 11일
His error message said he was using r2024a.
Min
Min 2025년 8월 12일
Thanks both. The issue is solved after a reboot. The reasons I really don't know...

댓글을 달려면 로그인하십시오.


Min
Min 2025년 1월 21일
이동: Walter Roberson 2025년 1월 21일
many thanks all! After rebooting the error is gone... Probably only god knows why...
  댓글 수: 1
Matteo
Matteo 2025년 8월 10일
Just to support the the comment - I just had the same problem and I also was able to run the code after rebooting. The dbstop if caught error command also stops at the same place, seems to have to do with some settings from matlab.io missing the 'text' entries. Maybe these settings were modified by something else and a fresh restart ensured that they were not affected?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calendar에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by