title: Count number of column in a pipe delimited file
body: <p>I have a pipe <code>|</code> delimited file. </p>
  
  <p><strong>File:</strong></p>
  
  <pre><code>106232145|"medicare"|"medicare,medicaid"|789
  </code></pre>
  
  <p>I would like to count the number of fields in each line. I tried the below code</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>awk -F '|' '{print NF-1}'
  </code></pre>
  
  <p>This returns me the result as 5 instead of 4. This is because the awk takes "medicare|medicaid" as two different fields instead of one field</p>