I’m trying to create a relevance statment to list files in a folder, excluding the two most recent files. I can write a stamement to exclude the most recent, but I’m having a hard time excluding the two most recent. Ideally I would want a statement that would allow me to change the number of files I want to exclude.
Here is what I have to exclude the most recently modified file:
pathnames of files whose (modification time of it != maximum of modification times of files of parent folder of it) of folder “C:\test”
This is a non-answer, but I think you can solve it by re-applying that same pattern, and using tuples to pass on both an individual file and the current set of files. If you’re still working on this, reply to this post and we can try to figure something out.
I was hoping for something that would be a little more flexible that would allow me to change the number of files easily (say from 2 to 10). I did try to get something like your suggesting to work, but didn’t have any luck. I always seem to have problems using maximum of in a set. Any help would be appreciated.
I was able to solve this using triple recursion (very inefficient with large sets of files)
q: tuple string item ((number of unique values of modification times of files of folder “c:\temp”) - 2) of concatenation ", " of following texts of firsts ", " of (it as string) of unique values of modification times of files of folder “c:\temp”
q: ((number of unique values of modification times of files of folder “c:\temp”) - 2)
q: files whose(modification time of it <= ((it as time) of tuple string item ((number of unique values of modification times of files of folder “c:\temp”) - 2) of concatenation ", " of following texts of firsts ", " of (it as string) of unique values of modification times of files of folder “c:\temp”)) of folder “c:\temp”
But, because the modification time has a comma (Wed, 28 May 2014 13:45:15 -0500), the tuple is detecting time as two items. Any suggestions on how I could get around that?