Error using readtable (line 318) Error when I Try to Read in a .dat File

Hi! I am using this code: filename=uigetfile('.dat'); and data=readtable(filename); however, I am continuing to run into the error: Error using readtable (line 318) Unable to find or open 'Laura Data.dat'. Check the path and filename or file permissions. I attached some helpful screenshots, I would really like to have this issue resolved as I am trying to make some plots with the .dat file. Some help would be incredibly appreciated.

 Accepted Answer

Try using the second output from uigetfile() as well, in order to refer to the full path of the file selected:
[filename,pathname] = uigetfile('.dat');
data = readtable(fullfile(pathname,filename));

3 Comments

I resolved this issue as I set the path to a new folder manually. Thank you for the help, much apprciated!
Hi Please, someone help here
Error using readtable (line 318)
Unable to find or open 'C:\Users\Dev\data\entNames.xlsx'. Check
the path and filename or file permissions.
Does the file 'C:\Users\Dev\data\entNames.xlsx' exist?
Also, please post your code.
It may be that you need to specify the full path properly, as in the original question and answer.

Sign in to comment.

More Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Asked:

on 18 Mar 2022

Commented:

on 25 Aug 2022

Community Treasure Hunt

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

Start Hunting!