A caution, if the column names are used in the output filename, as an example, a 60 character value with the last 50 as spaces, will have those 50 spaces in the filename for that column value. You will ant to have a method of stripping spaces from filenames.
If you can program the retrieval with API calls, do that so you have full control of your output filenames.