Help with nested cfdirectory tags
I was given a task to convert around 32,000 Excel spreadsheets to HTML fomat. I had them changed to CSV format, then used a ColdFusion script to do it, but now I have to create an index page for each of the directories. The aforementioned pages are grouped into around 15 directories, so I decided to use cfdirectory to build the initial index page, after which I copy/paste the generated code into a static page.
It was working great until they decided they wanted the Excel files to live in the directory with the cfm files. So now I need to make a table with a column for the cfm file, and a column for the xls. This means running two cfdirectory tags (one for the cfm files, and one for the xls files). The problem with this is that I can't nest the outputs from these.
Here's the code I'm working with (btw, there are two cfm files for each Excel):
<cfdirectory directory="#expandpath("./")#" name="getcfm" action="list" filter="part*.cfm">
<cfdirectory directory="#expandpath("./")#" name="getxls" action="list" filter="Part*.xls"><table border="1" cellspacing="0" cellpadding="5">
<tr>
<th scope="col">Location</th>
<th scope="col" colspan="3">Format</th>
</tr>
<cfoutput query="getcfm"><tr>
<th scope="row" class="row">#rereplace(listfirst(mid(getcfm.name,15,50),"_"),"(\b\w)","\u\1","ALL")#</th>
<td>HTML, <a href="#getcfm.name#">Number</a>
<td>HTML, <a href="#replace(getcfm.name,"number","pct")#">Pct</a></td></td>
<td><a href="#getxls.name#">Excel</a></td>
</tr>
</cfoutput></table>
This builds the table with the proper CFM files, but it gives me the same Excel file over and over. What I really need is a loop within the loop, but nothing I try works. Any ideas?
I guess my other option is to just make two tables, but I'd rather do just the one.
