How to Read a file with unknown name

14 Ansichten (letzte 30 Tage)
naman
naman am 24 Jan. 2017
Kommentiert: naman am 24 Jan. 2017
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 ?

Akzeptierte Antwort

John Chilleri
John Chilleri am 24 Jan. 2017
Bearbeitet: John Chilleri am 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!

Weitere Antworten (1)

Image Analyst
Image Analyst am 24 Jan. 2017
Use dir('*.csv') to get a list of all csv files in that folder. See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F

Kategorien

Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by