[% USE CSV -%]
[% CSV.dump([ 'Device' 'Model' 'Location' 'Port' 'SSID' 'Node Count' ]) %]

[% FOREACH row IN results %]
  [% mylist = [] %]
  [% mylist.push(row.dns || row.name || row.ip) %]
  [% mylist.push(row.model) %]
  [% mylist.push(row.location) %]
  [% mylist.push(row.port) %]
  [% mylist.push(row.ssid) %]
  [% mylist.push(row.mac_count) %]
  [% CSV.dump(mylist) %]

[% END %]
