I have a cfquery that returns over 3000 records from a database. The specific column I am working with is called FILEPATH and it does indeed include file paths to a variety of files (.pdf, .txt, .doc, etc.)
Here are a couple of example results
I am trying to parse out everything to the right of the last "/" in the string. So I'm looking to gather...
I am able to use the following to create an array
<cfset theString="#checkDb.FILEPATH#"> <cfset theArray=ListToArray(theString, "/")> <cfdump var=#theArray#>
Running this using the string "share/open/global/robots.txt" will indeed dump robots.txt
I then tried to loop through my database query in this manner:
<cfloop query="checkDb"> <cfset theString="#checkDb.FILEPATH#"> <cfset theArray=ListToArray(theString, "/")> <cfdump var=#theArray#> </cfloop>
This does not work. Should this be an index loop? I have tried a handful of possibilities, with no success yet.
I just want to dump out a full list of the files without the filepaths.
Any insight will be greatly appreciated. Thanks!