title: Windows Batch File to Read textfile and append for pdftk
body: <p>I have a text file which contains the location of a list of pdf files. I am writing a windows batch file that needs to read this line by line and append in a command which will be executed to merge all the pdfs into 1 pdf using pdftk.</p>
  <p>Below is the example command:</p>
  <pre><code>pdftk &quot;C:\test\1.pdf&quot; &quot;C:\test\2.pdf&quot;......&quot;C:\test\50.pdf&quot; cat output merged.pdf
  </code></pre>
  <p>I came across this <a href="https://stackoverflow.com/questions/155932/how-do-you-loop-through-each-line-in-a-text-file-using-a-windows-batch-file">How do you loop through each line in a text file using a windows batch file?</a> for reading text file.</p>
  <p>But how do I read and append to a variable which can then be used for the command mentioned above?</p>