I have a folder containing around 300,000 files. I don't need to import all the files.
Problem: How can I import the files based on specific file name?
Problem example:
In the picture below I have a section of the files, which are all in the same folder. I only want to import the .data files. But I don't need all the .data files to be import only the last one of every serie.
Up until now I have the following code:
files = dir(fullimpfile(pwd,'*.data*'));expData = cell(length(files),1);for i = 1:length(files) fid = fopen(fullfile(files(i).folder,files(i).name),'r'); %% Reading the data % Read all the data from the file
dataRead = textscan(fid,'%f %f %f %f %f %f %f %f %f %f %f %f %f %f','HeaderLines',1);end
This code imports all of the data files. How can I use I think a for loop to only import only the last .data files of every serie?
Best Answer