• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Packing directory output to a list

New Here ,
Sep 22, 2009 Sep 22, 2009

Copy link to clipboard

Copied

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> 

TOPICS
Advanced techniques

Views

530

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 22, 2009 Sep 22, 2009

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation