Receiving error "Unable to open csv file". What could be causing this issue?
Mostrar comentarios más antiguos
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 comentarios
Milan Bansal
el 9 de Sept. de 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
el 9 de Sept. de 2024
Norma
el 9 de Sept. de 2024
Torsten
el 9 de Sept. de 2024
The filename you want to open really is xxx.xx.xx.csv ?
Stephen23
el 9 de Sept. de 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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Text Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!