title: How to extract 100 numbers at a time from a text file?
body: <p>I am absolutely new to bash scripting but I need to perform some task with it. I have a file with just one column of numbers (6250000). I need to extract 100 at a time, put them  into a new file and submit each 100 to another program. I think this should be some kind of a loop going through my file each 100 numbers and submitting them to the program. </p>
  
  <p>Let's say my numbers in the file would look like this.</p>
  
  <pre><code>1.6435
  -1.2903
  1.1782
  -0.7192
  -0.4098
  -1.7354
  -0.4194
   0.2427
   0.2852
  </code></pre>
  
  <p>I need to feed each of those 62500 output files to a program which has a parameter file. I was doing something like this: </p>
  
  <pre><code>lossopt()
  {
  cat&lt;&lt;END&gt;temp.par
  Parameters for LOSSOPT
  ***********************
  
  START OF PARAMETERS:
  lossin.out                            \Input file with distribution
  1                                       \column number
  lossopt.out                             \Output file
  -3.0 3.0   0.01                      \xmin, xmax, xinc
  -3.0 1
  0.0 0.0
  0.0 0.0
  3.0 0.12
  
  END
  }
  for i in {1..62500}
  do
  sed -n 1,100p ./rearnum.out &gt; ./lossin.out
  echo temp.par | ./lossopt &gt;&gt; lossopt.out
  rm lossin.out
  cut -d " " -f 101- rearnum.out &gt; rearnum.out
  done
  </code></pre>
  
  <p>rearnum is my big initial file</p>