I have a lot of data files that I would like to process through my code, which will generate output files. Currently I have written a program wherein I have to type each file name in the code and generate the output file. And I have to repeat it for every data file. Is there any way to program so as to take each file from a specified folder one at a time and generate the output file in the same folder, till all the files in the specified folder is exhausted. The output file name shall be "input-filename"+T_esa.txt. i.e. if the datafile is 18_mj.txt then the output filename should be 18_mjT_esa.txt.
The data file will contain characters, numerals, and special characters.
Extracts from the current code is given below.
If you need anyother information kindly comment below.
Any help would be appreciated. Thank you for your time.
[xdata, ydata] = textread('C:\Users\dell\Desktop\18_mj.txt','%f %f','headerlines',0);
fid = fopen('C:\Users\dell\Desktop\18_mjT_esa.txt','w');