title: Parsing iw wlan0 scan output
body: <p>I wrote wlan manager script to handle open/ad-hoc/wep/wpa2 networks. Now im trying to parse iw wlan0 scan output to get nice scan feature to my script. My goal is to get output like this :</p>
  
  <pre><code>SSID        channel     signal      encryption
  wlan-ap     6           70%         wpa2-psk
  test        1           55%         wep
  </code></pre>
  
  <p>What i have achived already is output like this :</p>
  
  <pre><code>$ iw wlan0 scan | grep 'SSID\|freq\|signal\|capability' | tac
  SSID: Koti783
  signal: -82.00 dBm
  capability: ESS Privacy ShortPreamble SpectrumMgmt ShortSlotTime (0x0531)
  freq: 2437
  </code></pre>
  
  <p>I have been trying to study bash/sed/awk but havent found yet a way to achieve what im trying. So what is good way to achieve that?</p>