MATLAB: Reading .csv files from .txt file.

commandcsv fileslooptxt

Hello,
I have a .txt file with 7lines and 4 columns, and 4 csv files(with names a.csv, b.csv, c.csv and d.csv). In the first column there are the names of my .csv files( Imean a.csv, b.csv,c.csv and d.csv).
I would like via a loop to read each of my .csv files , depending on the line with the same name/line( Imean in the first column of the first Line of my .txt file has the name 'a.csv'. Depending on this I would to read the 'a.csv' file.
Could anyone help me?

Best Answer

How to read text files is maybe the most frequently asked question. Among many solutions, you can either directly read the txt file with native Matlab functions, or use my readfile function. In this case the added benefit of that file is 0, but in the future it may be handy to already have that function.
Then you can read the relevant csv file with the readmatrix function.