Outputs CSV files from Custom Queries