 <p>As per my understanding, you want to filter-out file names with a specific file type/extension (ex: pdf) from the main list <code>uploadedfilenames</code>. This is one of the easiest ways:</p> <pre><code>&lt;cfset lFileNames = "C:\myfiles\proj\icon-img-12.png,C:\myfiles\proj\sample-file.ppt,C:\myfiles\proj\fin-doc1.docx,C:\myfiles\proj\fin-doc2.pdf,C:\myfiles\proj\invoice-temp.docx,C:\myfiles\proj\invoice-final.pdf" /&gt; &lt;cfset lResultList = "" /&gt; &lt;cfset fileExtToExclude = "pdf" /&gt; &lt;cfloop list="#lFileNames#" index="fileItem" delimiters=","&gt; &lt;cfif ListLast(ListLast(fileItem,'\'),'.') NEQ fileExtToExclude&gt; &lt;cfset lResultList = ListAppend(lResultList,"#fileItem#") /&gt; &lt;/cfif&gt; &lt;/cfloop&gt; </code></pre> <p>Using only List Function provided by ColdFusion this is easily done, you can test and try the code <a href="http://trycf.com/gist/5c726ca8c851a4ea072f/acf11?theme=monokai" rel="nofollow">here</a>. I would recommend you to wrap this code around a function for easy handling. Another way to do it would be to use some complex regular expression on the list (if you're looking for a more general solution, outside the context of ColdFusion).</p> <p>Now, applying the solution to your problem:</p> <pre><code>&lt;cfset uploadedfilenames='#myfiles.clientFile#' &gt; &lt;cfset lResultList = "" /&gt; &lt;cfset fileExtToExclude = "pdf" /&gt; &lt;cfloop list="#uploadedfilenames#" index="fileItem" delimiters=","&gt; &lt;cfif ListLast(ListLast(fileItem,'\'),'.') NEQ fileExtToExclude&gt; &lt;cfset lResultList = ListAppend(lResultList,fileItem) /&gt; &lt;/cfif&gt; &lt;/cfloop&gt; &lt;cfset uploadedfilenames = lResultList /&gt; &lt;!--- rest of your code continues ---&gt; </code></pre> <p>The result list <code>lResultList</code> is copied to the original variable <code>uploadedfilenames</code>.</p>