title: Reading timeseries from multiple csv files in a folder: MATLAB
body: <p>I have a bunch of csv files in a folder in following format, I want to extract complete time series from each (the numeric part from line #17), identify duplicate record and merge them in a ascending order according to year and date. 
  Specific csv file is accessible via google drive link below </p>
  
  <pre><code>    wnsnum  1           
      paroms  Waterhoogte                                                             
      loccod  HOEKVHLD                                                                
      locoms  Hoek van Holland                                                        
      rks_begdat  1993 07 09          
      rks_begtyd  00:00           
      rks_enddat  2014 31 12          
      rks_endtyd  23:50           
      begdat  begtyd  enddat  endtyd  rkssta
      1993 07 09  00:00   2007 31 12  23:50   D     
      2008 01 01  00:00   2009 30 12  23:50   G     
      2009 31 12  00:00   2009 31 12  23:50   O     
      2010 01 01  00:00   2011 17 06  18:40   G     
      2011 17 06  18:50   2011 18 06  18:50   O     
      2011 18 06  19:00   2014 31 12  23:50   G     
      datum   tijd    bpgcod  waarde  kwlcod
      1993 07 09  00:00       -70 0
      1993 07 09  00:10       -69 0
      1993 07 09  00:20       -68 0
      1993 07 09  00:30       -67 0
      1993 07 09  00:40       -68 0
      1993 07 09  00:50       -70 0
      1993 07 09  01:00       -69 0
      1993 07 09  01:10       -69 0
      1993 07 09  01:20       -68 0
      1993 07 09  01:30       -67 0
      1993 07 09  01:40       -65 0
      1993 07 09  01:50       -64 0
      1993 07 09  02:00       -62 0
      1993 07 09  02:10       -61 0
      1993 07 09  02:20       -61 0
      1993 07 09  02:30       -59 0
      1993 07 09  02:40       -58 0
      1993 07 09  02:50       -55 0
  </code></pre>
  
  <p>Now my code is working in a following way:</p>
  
  <pre><code>SL_files = dir(sprintf('%s%s%s',fullfile(dirName),'\','*.csv'));
  for idx = 1:size(SL_files,1)
      disp(SL_files(idx,1).name)
      fid = fopen(sprintf('%s%s%s',fullfile(dirName),'\',SL_files(idx,1).name)); 
      data = textscan(fid, '%s %f %f %f %f %f %f', ...
        'Delimiter',',', 'MultipleDelimsAsOne',1,'headerlines',16);
  
      fclose(fid);
  end
  </code></pre>
  
  <p>Now I could read the file. Now my problem is how to combine multiple files' data into one matrix and arrange them in a ascending order according to year and day values. Thanks!    </p>