combining text files from separate folders to one text file using for loop
3 views (last 30 days)
I have two folders namely 'tmax' and 'tmin'. I have text files having names tmax_1,tmax_2,tmax_3 and tmin_1, tmin_2,tmin_3 located in the folders tmax and tmin, respectively. I want to combine tmax_1 and tmin_1 having single column from the two folders to create a new text file namely tmean_1 consisting of two columns. Similarly, I want to combine the remaining two files using for loop.
Rik on 20 May 2020
for n_file=1:3%or use dir() to find which files you have
data_max=___%read data to vector
data_min=___%read data to vector
%write data to file (e.g. with fprintf)