title: Trim leading and trailing spaces from a string in awk
body: <p>I'm trying to remove leading and trailing space in 2nd column of the below <code>input.txt</code>:</p>
  
  <p><code>Name, Order  </code><br>
  <code>Trim, working</code><br>
  <code>cat,cat1</code></p>
  
  <p>I have used the below <code>awk</code> to remove leading and trailing space in 2nd column but it is not working. What am I missing?</p>
  
  <pre><code>awk -F, '{$2=$2};1' input.txt
  </code></pre>
  
  <p>This gives the output as:</p>
  
  <p><code>Name, Order  </code><br>
  <code>Trim, working</code><br>
  <code>cat,cat1</code></p>
  
  <p>Leading and trailing spaces are not removed.</p>