Receiving error "Unable to open csv file". What could be causing this issue?
Show older comments
Hello, I'm trying to convert my .csv file into a table. I'm receiving the error above. It also says "Error: readtable(filename)" when converting the .csv file to a table. I've tried changing the name of the file or editing the file path but, I'm still getting the error. What could be the cause of this error?
%Opens file explorer to select .csv file
[filename, ~] = uigetfile("*.*");
%The data variable is just an example variable name
data = readtable(filename);
%Convert the table to a times table
T = table2timetable(data);
%Display summary of data so I can start manipulating the headers
summary(T);
6 Comments
Milan Bansal
on 9 Sep 2024
Hi @Norma, please mention the exact error you are facing for better understanding of the problem. If possible, please the share the CSV as well using the paper clip icon.
Norma
on 9 Sep 2024
Norma
on 9 Sep 2024
Torsten
on 9 Sep 2024
The filename you want to open really is xxx.xx.xx.csv ?
Stephen23
on 9 Sep 2024
Do NOT change folders just to read/write data files. This is slow and makes debugging harder.
Do NOT add folders to the MATLAB Search Path just to read/write data files. This pointlessly pollutes the search path with files, which slows down MATLAB. Similarly, do not keep your data files on the search path!
The reliable and efficient approach is to use absolute/relative filenames. FULLFILE helps with that.
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!