Scrolling files in a folder in matlab

I have a set of days of log files that I need to parse and look in Matlab.

The log files are as follows:

LOG_20120509_120002_002.csv (year)(month)(day)_(hour)(minute)(second)_(log part number) 

Hourly log processing, but sometimes seconds - one or two seconds (per hour), which means that I need to ignore what they say loadcsv .

I also have another file:

 LOG_DATA_20120509_120002.csv 

which contains data for the entire hour (different data).

The overall goal is to:

  loop through each day loop through each hour read in LOG_DATA for whole hour loop through each segment read in LOG for each segment compile a table of all the data 

I think the question is, how do I ignore the minutes of the day if they are different? I suspect that this will be by enumerating all the files in the folder, in which case, how to do this?

+47
loops file-io matlab csv
Jul 23 '12 at 23:10
source share
1 answer

Penetration of all files in a folder is relatively simple:

 files = dir('*.csv'); for file = files' csv = load(file.name); % Do some stuff end 
+76
Jul 23 '12 at 23:15
source share



All Articles