title: how can i compare the columns from different lines in awk
body: <p>Suppose i have this file</p>
  
  <pre><code>var1 300
  var1 400
  var3 600
  var1 200
  </code></pre>
  
  <p>Now how can i compare the <code>$1(from line 1) == $1 (from line 2)</code></p>
  
  <p>basically i just want to add the columns if the name is equal</p>
  
  <p>Only with <code>awk</code></p>
  
  <p>The output should br</p>
  
  <pre><code>var1 900
  var3 600
  </code></pre>