How to Read a file with unknown name

Hi
I get one .csv file in a directory and I cannot control the name of it. Therefore, I want to read it without knowing its name. How can I do it ?

 Accepted Answer

John Chilleri
John Chilleri on 24 Jan 2017
Edited: John Chilleri on 24 Jan 2017
Hello,
You can do so like this (assuming only one csv file):
A = dir('*.csv');
B = csvread(A.name);
Hope this helps!

More Answers (1)

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 24 Jan 2017

Commented:

on 24 Jan 2017

Community Treasure Hunt

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

Start Hunting!