title: Batch file to merge many excel files in one, but copy them in order of the date modified
body: <p>So I'm trying to merge many excel files and .csv files in one directory into one .csv file. I use the following code:</p>
  
  <pre><code>&gt; echo off
  &gt; 
  &gt; copy /a *.* merged.csv
  &gt; 
  &gt; end
  </code></pre>
  
  <p>And it works just fine but when it merges the files it does it in an alphabetical order which is inconvenient for me. Is there a way to merge them in the order that they were last modified? And if this is not possible, is it at least possible to create a batch file that takes all the names of the files and copies them into their first cell(the A1 cell)? Ex: If the file is named 01-01-2014.xls the name "01-01-2014" to appear in the A1 cell of the file(and this to be done for all the files in the directory). Note: The A1 cell is always empty(if it matters). Thank you very much in advance</p>