title: Windows batch - concatenate multiple text files into one. The text file names are stored in a list
body: <p>I'm a novice to windows batch - I want to concatenate multiple text files into one using windows batch. The files to be combined are specified in a list and could be dynamic. I have a single directory of files a.txt, b.txt, c.txt .... z.txt. I need to concatenate a subset of them into a  merged.txt
  For example if list is the input list</p>
  
  <p>set list=a f z</p>
  
  <p>Then I want the merged.txt to have contents of a.text, f.txt and z.txt.
  Ideas I have already tried are</p>
  
  <p>1)type *.txt > merged.txt :- wont work for me as that would combine all text files.</p>
  
  <p>2)copy a.txt+f.txt+z.txt merged.txt :-But that would only combine just for this one input. </p>
  
  <p>Does anyone have any ideas ?</p>