title: How to grep two column from a single file
body: <p>cat Error00</p>
  
  <pre><code>4  0    375
  4 2001   21
  4 2002   20
  </code></pre>
  
  <p>cat Error01</p>
  
  <pre><code>4 0      465
  4 2001   12
  4 2002   40
  4 2016   1
  </code></pre>
  
  <p>I want output as below</p>
  
  <pre><code>4 0      375   465
  4 2001   21    12
  4 2002   20    20
  4 2016   -     1
  </code></pre>
  
  <p>i am using the below query. here problem is i m not able to handle grep for two field because space is coming. 
  please suggest how can to get rid of this.</p>
  
  <pre><code>keylist=$(awk '{print $1,$2'} Error0[0-1] | sort | uniq)
  for key in ${keylist} ; do
  echo ${key}
          val_a=$(grep "^${key}" Error00 | awk  '{print $3}') ;val_a=${val_a:---}
          val_b=$(grep "^${key}" Error01 | awk '{print $1,$2}') ; val_b=${val_b:---    --}
          echo $key  ${val_a} &gt;&gt;testreport
  done
  </code></pre>
  
  <p>i m geting the oputput as below</p>
  
  <pre><code>4       375   465
  0
  4       21    12
  2001
  4       20    20
  2002
  4       -     1
  2016
  </code></pre>