title: Awk: splitting a field
body: <p>new to awk and try to do something that's probably simple but it's taking me a while.  To simplify things, I have a text file called 'sample' and it contains the following line:</p>
  
  <blockquote>
    <p>164516454242451BX%Apt 110 225 1784 Ohio USA</p>
  </blockquote>
  
  <p>I want to get the following output using awk:</p>
  
  <blockquote>
    <p>Apt 110 225</p>
  </blockquote>
  
  <p>Is there a way I can split $1 so that "Apt" is a separate field?  The code I'm trying is the below.  I recieve no error, but the output is just 2 blank lines.</p>
  
  <pre><code>awk '
  BEGIN {
  split($1," ","%")
  }
  print $2,$3,$4
  END {
  print ""
  } ' sample
  </code></pre>