READ DATA OF MULTIPLE CSV FILES

2 views (last 30 days)
AMAN GUPTA
AMAN GUPTA on 10 Mar 2022
Answered: KSSV on 10 Mar 2022
I have 360 csv files named 1.csv, 2.csv,...360.csv. Each csv file has different no of rows. How can I read 360 csv file using for loop? Please help me.

Accepted Answer

KSSV
KSSV on 10 Mar 2022
csvFiles = dir('*.csv') ;
N = length(csvFiles) ;
for i = 1:N
T = readtable(csvFiles(i).name) ;
% Do what you want
end

More Answers (0)

Community Treasure Hunt

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

Start Hunting!