Skip to main content
Known Participant
September 22, 2009
Question

Packing directory output to a list

  • September 22, 2009
  • 1 reply
  • 579 views

I am new to this, I have tons of directories that I am working on. I want to output the files in each directory to a comma delimited list with each list named after  the directory containing the files.  So far I have been able to write a code that groups each files underneath each directory but i'm stuck as to the list part, I need help as to packing the output into a list thanks for your assistance.

I have gotten as far as this

<cfset dir = ("D:\dox\")>

<cfdirectory name="Getdir" action="list" directory="#dir#" type="All" recurse="yes">

<cfquery dbtype="query" name="Getfiles">

SELECT * FROM Getdir ORDER BY directory, name </cfquery>

<CFOUTPUT QUERY="GetBoth" GROUP="directory">

<br><B>#GetBoth.directory#</B></FONT><br>

<CFOUTPUT>#GetBoth.name#<BR></CFOUTPUT>

</CFOUTPUT> 

This topic has been closed for replies.

1 reply

Inspiring
September 22, 2009

OK, well you can use valueList() to extract an entire query column as a list.  So that is easy enough.  However that requires the correct data to be in a single column.  So you might want to look at what columns you're fetching with your QoQ, and adjust that to better suit your requirement.

--

Adam