title: How to loop through CSV files, skip first 5 lines and write to a consolidated CSV
body: <p>I have a bunch of CSV files in a directory. I want to loop through each and every file, get rid of the first 5 lines in each file and write the remaining lines to a CSV file "Consolidated_wo_first5.csv". My files are ";" separated.</p>
  
  <p>My windows script:</p>
  
  <pre><code>set sourcedir=C:\transport\in
  set targetdir=C:\transport\out
  
  for %%F in (%sourcedir%\*.csv) do (for %%f "skip=5 tokens=* delims=;" in (%%~nf) do echo %%a)&gt;&gt;%targetdir%\Consolidated_wo_first5.csv
  </code></pre>
  
  <p>Sample input file:</p>
  
  <pre><code>Row1 ;Row1;Row1
  Row2;Row2;Row2
  Row3;Row3;Row3
  Row4;Row4;Row4
  Row5;Row5;Row5
  Row6;Row6;Row6
  Row7;Row7;Row7
  </code></pre>
  
  <p>Thanks for your help!</p>