title: to copy specific line numbers from one file to specific line numbers of another file using awk
body: <p>I have a .txt file with 71 lines and I have another 12 set of files(file1 to file12). I want to copy first 5 lines from .txt file to file1 on specific line numbers similarly next 5 lines from .txt to file2 again on specific line numbers and so on.</p>
  
  <p>This is my current code:</p>
  
  <pre><code>n = 1
  sed -i '52,56d' $dumpfile 
  awk'{print $'"$n"',$'"$n+1"',$'"$n+2"',$'"$n+3"'}' sample.txt &gt; $dumpfile
  n=$(($n + 1))
  </code></pre>
  
  <p>In <code>$dumpfile</code> I have put my 12 files.</p>
  
  <p>Sample file (12files; file1, file2...)</p>
  
  <pre><code>...........  
  ................  
  ..............  
  abc = 4,1,3  
  def = 1,2,6  
  dfg = 28,36,4  
  tyu = 68,47,6  
  rty = 65,6,97 
  </code></pre>
  
  <p>file (sample.txt)</p>
  
  <pre><code>abc = 1,2,3  
  def = 4,5,6  
  dfg = 2,3,4  
  tyu = 8,7,6  
  rty = 5,6,7
  
  abc = 21,2,32  
  def = 64,53,6  
  dfg = 28,3,4  
  tyu = 18,75,6  
  rty = 5,63,75
  
  ...........  
  ...........  
  </code></pre>
  
  <p>I want to replace these five lines of (file1... file12) with five lines of sample.txt file. Line number of lines to be replaced in file1 to file12 are same in all the 12 files, where as in sample.txt file first set of 5 lines will go in file1, second set of 5 lines will go in file2 and so on upto file12.</p>