How to Read a file with unknown name
조회 수: 10 (최근 30일)
이전 댓글 표시
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 ?
댓글 수: 0
채택된 답변
John Chilleri
2017년 1월 24일
편집: John Chilleri
2017년 1월 24일
Hello,
You can do so like this (assuming only one csv file):
A = dir('*.csv');
B = csvread(A.name);
Hope this helps!
추가 답변 (1개)
Image Analyst
2017년 1월 24일
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
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!