title: How to print list item use by user using awk
body: <p>I have 2 file input file <br />
  input1 is username, tool and number:</p>
  <pre><code>######
  User: a
  #####
  aem       12
  aqwt      24
  #####
  User: B
  #####
  aem       34
  bwem      52
  dd        12
  #####
  User: C
  #####
  aem       11
  aqwt      2
  dd        1
  ##### 
  </code></pre>
  <p>input2 is list of tool:</p>
  <pre><code>aem
  aqwt
  bwem
  dd
  </code></pre>
  <p>I want to make output of user and tool and if don't have tool it will assign 0:</p>
  <pre><code>Tool  a   B   C
  aem   12  34  11
  aqwt  24  0   2
  bwem  0   52  0
  dd    0   12  1
  </code></pre>
  <p>I have try awk to compare file2 and file1 to print the number but the script will print also line in comment:</p>
  <pre><code>awk 'NR==FNR{a[$1];next} ($1 in a); {print $2} !($1 in a); {print &quot;0&quot;}' input2 input1
  </code></pre>
  <p>the output will be:</p>
  <pre><code>0
  0
  0
  12
  24
  0
  0
  0
  34
  52
  12
  0
  0
  0
  11
  2
  1
  0
  </code></pre>
  <p>Anyone know how to seperate it by column and make it skip the comment line? im new in this languag, thank you</p>