title: replace particular column value using awk if found
body: <p>How can I find and replace value for particular column using <code>awk</code>?</p>
  <p>Say for example -&gt; I have a file test having the content:</p>
  <blockquote>
  <p>&quot;abc&quot;:&quot;100&quot;::&quot;new&quot;</p>
  <p>&quot;xyz&quot;:&quot;200&quot;:&quot;mob&quot;:&quot;old&quot;</p>
  <p>&quot;lmn&quot;:&quot;300&quot;::&quot;new&quot;</p>
  <p>&quot;pqr&quot;:&quot;400&quot;:&quot;mob2&quot;:&quot;new&quot;</p>
  </blockquote>
  <p>Now, if 3rd column is blank then I want to replace the blank value from <code>&quot;N/A&quot;</code> otherwise print the line as it is, so that the output would be like:</p>
  <blockquote>
  <p>&quot;abc&quot;:&quot;100&quot;:&quot;N/A&quot;:&quot;new&quot;</p>
  <p>&quot;xyz&quot;:&quot;200&quot;:&quot;mob&quot;:&quot;old&quot;</p>
  <p>&quot;lmn&quot;:&quot;300&quot;:&quot;N/A&quot;:&quot;new&quot;</p>
  <p>&quot;pqr&quot;:&quot;400&quot;:&quot;mob2&quot;:&quot;new&quot;</p>
  </blockquote>
  <p>Although I got the output using awk through below command:</p>
  <pre><code>awk -F&quot;:&quot; '{
      if ( $3 == &quot;&quot;)
          print $1&quot;:&quot;$2&quot;:\&quot;N\/A\&quot;:&quot;$4
      else
          print $0
  }' test
  </code></pre>
  <p>But here I am using the hard coded values for each column like <code>$1</code>, <code>$2</code>, so if the blank column changes in other example from 3rd to xyz then have to change the same in command again. Is there any other way to get the same output using awk and without using hard coded values for columns? Thanks for your help.</p>