6 Replies Latest reply on Oct 14, 2008 6:54 PM by -==cfSearching==-

    query result to ASCII file output

    auntiealias
      Seems like there SHOULD be some rediculously simple solution to this - but I sure haven't found it yet! I have a query which produces the a varying number of columns (based on a multi-select cfselect) which I need to output to a comma delimited ASCII (.TXT or .DAT or .CSV file). I have all the steps worked out when the number of columns and their names are known, but I need to make this variable. First choice would be to be able to just "DUMP" the query result into a text file. CFDUMP can send results to a text file, but NOT in comma delimited format, and with all kinds of info besides just the basic data. (NOT good!) Second choice, since the "append to text file" uses an output property that expects a comma delimited string variable would be to use CFLOOP to loop thru the rows in the query and put them (a row at a time) into a variable, then use that variable for the file append. Problem is I can't find a way to just say "send *ALL* to the string variable. Every example I have been able to find includes specifying the column NAMES when doing anything with a row in the query result!!! Short of a brute force series of if/then statements that specify EACH POSSIBILITY (in this case 60 - 75 of them, and the number WILL GROW!) I haven't been able to find a solution. There's GOTTA BE A WAY!!!!! :)