title: Merge multiple files preserving the original sequence in unix
body: <p>I have multiple (more than 100) text files in the directory such as </p>
  
  <pre><code>files_1_100.txt
  files_101_200.txt
  </code></pre>
  
  <p>The contents of the file are name of some variables like <code>files_1_100.txt</code> contains some variables names between 1 to 100 </p>
  
  <pre><code>"var.2"
  "var.5"
  "var.15"
  </code></pre>
  
  <p>Similarly <code>files_201_300.txt</code> contains some variables between 101 to 200</p>
  
  <pre><code>"var.203"
  "var.227"
  "var.285"
  </code></pre>
  
  <p>and <code>files_1001_1100.txt</code> as</p>
  
  <pre><code>"var.1010"
  "var.1006"
  "var.1025"
  </code></pre>
  
  <p>I can merge them using the command </p>
  
  <pre><code>cat files_*00.txt &gt; ../all_files.txt
  </code></pre>
  
  <p>However, the contents of files does not follow that in the parent files. For example <code>all_files.txt</code> shows </p>
  
  <pre><code>"var.1010"
  "var.1006"
  "var.1025"
  "var.1"
  "var.5"
  "var.15"
  "var.203"
  "var.227"
  "var.285"
  </code></pre>
  
  <p>So, how can I ensure that contents of <code>files_1_100.txt</code> comes first, followed by <code>files_201_300.txt</code> and then <code>files_1001_1100.txt</code> such that the contents of the <code>all_files.txt</code> is </p>
  
  <pre><code>"var.1"
  "var.5"
  "var.15"
  "var.203"
  "var.227"
  "var.285"
  "var.1010"
  "var.1006"
  "var.1025"
  </code></pre>