title: copy specific line of ith file to another file as ith line
body: <p>I am going to do sdv calculation.</p>
  
  <p>I have lots of files. Each file has 2000 lines. I only need the last line (2000th) of each file, and I want to copy each of them into one file.</p>
  
  <p>For example, </p>
  
  <pre><code>last line of first file will be the first line of new file
  last line of second file will be the second line of new file.
  .......
  ......
  last line of nth file will be nth line of the new file.
  </code></pre>
  
  <p>I am thinking something like this:</p>
  
  <pre><code>case=$1 # total numer of files
  for (( i = 1; i &lt;= $case ; i ++ ))
  do
      file=PPD$i           # files are numbered as PPD1, PPD2.....PPDi
      some command.....&gt;final.dat
  done
  </code></pre>