[% USE CSV -%]
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'STP Status' ]) %]

[% FOREACH row IN results %]
  [% mylist = [] %]
  [% mylist.push(row.dns || row.name || row.ip) %]
  [% mylist.push(row.port) %]
  [% mylist.push(row.description) %]
  [% mylist.push(row.stp) %]
  [% CSV.dump(mylist) %]

[% END %]
