title: awk print substr() by character index, ignoring the space at the end of substr
body: <p>I have a data like this</p>
  
  <pre><code>12345678901234567890123456789012345678 // this line just character index //
  a0001 some text           other_data_1
  a0002 some_text_connected other_data_2
  a0003                     other_data_3
  </code></pre>
  
  <p>In substr($0, 7, 20) of each line, there are some text. I could print the note text by </p>
  
  <pre><code>awk '{print substr($0,7,20)}' testfile
  </code></pre>
  
  <p>and get:</p>
  
  <pre><code>some text          
  some_text_connected
  (20 spaces here)                           
  </code></pre>
  
  <ol>
  <li><p>How could <strong>delete the space at the end of each substr</strong>($0, 7,20) and print the text?</p></li>
  <li><p>If a substr($0, 7,20) is empty, print N/A instead?</p></li>
  </ol>
  
  <p>Thanks in advance!</p>