title: Batch extracting lines from text files to one CSV
body: <p>So I have a very simple question, but I am a little retarded and so need some help!</p>
  
  <p>I need a command-line batch file that does the following:</p>
  
  <p>I have 5,000 text files, that all have the same structure (i.e. the same fields on each line), but different data. I would like to extract data from lines 3 and 5 in batch for all the files, and put this into one simple CSV, that also labels the filename.</p>
  
  <p>For example, the text files (labled 1.txt through to 5000.txt) look like this:</p>
  
  <pre><code>[data on line 1]
  [data on line 2]
  [data on line 3]
  [data on line 4]
  [data on line 5]
  [data on line 6]
  </code></pre>
  
  <p>And the desired output in CSV I am after is something like this:</p>
  
  <pre><code>[Filename 1.txt],[Data from line 3],[Data from line 5]
  [Filename 2.txt],[Data from line 3],[Data from line 5]
  </code></pre>
  
  <p>and so forth...</p>
  
  <pre><code>[Filename 5000.txt],[Data from line 3],[Data from line 5]
  </code></pre>
  
  <p>Any ideas?</p>