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

51 ビュー (過去 30 日間)
Min
Min 2025 年 1 月 20 日
移動済み: Walter Roberson 2025 年 1 月 21 日
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
  11 件のコメント
Stephen23
Stephen23 2025 年 1 月 21 日
Contact TMW directly for technical support: https://www.mathworks.com/support/contact_us.html
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.

サインインしてコメントする。

回答 (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' }
  1 件のコメント
Min
Min 2025 年 1 月 21 日
I don't think it's to do with misspelling...
>>
aaa = readtable('G:\My Drive\Project_GDrive\MMP9\data\aaa.csv');
Error using readtable (line 517)
Unrecognized field name "text".
>>
aaa = readtable("C:\Users\minuser\Desktop\aaa.csv");
Error using readtable (line 517)
Unrecognized field name "text".

サインインしてコメントする。


Min
Min 2025 年 1 月 21 日
移動済み: Walter Roberson 2025 年 1 月 21 日
many thanks all! After rebooting the error is gone... Probably only god knows why...

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by