Convert the output of an arbitrary query to a spreadsheet