title: Shell script to compare two specific rows in a single CSV file
body: <p>I am trying to learn shell script. I have a single CSV file, which is in bellow format: </p>
  
  <pre><code>Time, value1, value2, value3
  12-17 17:47:55.380,1,2,9
  12-17 17:48:55.380,8,4,9
  12-17 17:49:55.380,1,2,9
  12-17 17:50:55.380,8,4,9
  </code></pre>
  
  <p>I am looking for csv output something like bellow:</p>
  
  <pre><code>0,0,0,0
  1,7,2,0
  1,-7,-2,0
  1,7,2,0
  </code></pre>
  
  <p>Till now I have written code:</p>
  
  <pre><code>First_value=ps -ef |awk "NR==1{print ;exit}" try.csv Second_value=ps -ef |awk "NR==2{print ;exit}" try.csv  echo diff = $Second_value - $First_value
  </code></pre>
  
  <p>But I am getting error like:</p>
  
  <blockquote>
    <p>read.sh: 14: read.sh: 12-17:not found.</p>
  </blockquote>
  
  <p>Following are my queries:</p>
  
  <ul>
  <li>I am not able to put this in loop and get the output. I would like to
  know, how i can write the result back to same csv file,but at
  particular row and column.</li>
  </ul>