Unable to import .csv file

9 次查看(过去 30 天)
MyKah Smith
MyKah Smith 2022-2-8
评论: Jan 2022-2-8
I've tried using the readtable function T = readtable('myfile.csv') for a specific .csv file I'm trying to import but whenever I try to run the section I get this error message:
Error using readtable (line 498)
Unable to find or open 'Rho_ISA.csv'. Check the path and filename or file permissions.
Error in untitled (line 1)
T = readtable('Rho_ISA.csv')
How do I fix this?

采纳的回答

Jan
Jan 2022-2-8
The message is clear: "Unable to find or open 'Rho_ISA.csv'"
This means, that this file is not found in the current folder. So simply provide the path to the file also:
Folder = 'C:\Your\Folder'; % Adjust for your needs
T = readtable(fullfile(Folder, 'Rho_ISA.csv'))
  2 个评论
MyKah Smith
MyKah Smith 2022-2-8
Sorry I've tried to adjust the code but the same error message is coming up. This is what I've done:
Assignment = 'C:\Assignment';
T = readtable(fullfile(Assignment,'Rho_ISA.csv'));
Jan
Jan 2022-2-8
The the error message tells you, that the folder "C:\Assignment" does not contain a file called "Rho_ISA.csv".
Try it:
Assignment = 'C:\Assignment';
isfile(fullfile(Assignment, 'Rho_ISA.csv'))
Maybe the file name does not contain an "I" (uppercase i) but an l (lowercase L). Or you hide the file extension and the real file is called "Rho_ISA.csv.xls".
In any way, this is not a problem of readtable(), but the file is missing.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by