Jump to content


Filter files by date/time

  • Please log in to reply
1 reply to this topic

#1 mb



  • Administrators
  • 11521 posts
  • Gender:
  • Location:

Posted 18 September 2009 - 01:10 PM

Add more sophisticated filter expression to transfer filter.

VARIABLE = [File.Name, File.Path, File.ModifiedTime, File.Size, File.Type]
OPERATOR = [ logical [>, <, >=, <=, ==, !=, ||, &&], arithmetic [+, -, *, /] ]
FUNCTION = [WildChar(pattern, string), RegExp(pattern, string), Date.Parse(string), Date.ParseSpan(string). Date.Now()]
CONST = [sfFileTypeFolder, sfFileTypeFile, sfFileTypeUnknown, MEGABYTE, KILOBYTE]


Sample Expressions:
File.ModifiedTime >= Date.Now() - Date.ParseSpan("01:00")
File.ModifiedTime > Date.Parse("2009-12-31")
WildChar("*.txt", File.Name)
RegExp("^.*\\.txt$", File.Name)
File.Size > 100000
File.Type == sfFileTypeFolder

Function Date and DateSpan:
ISO 8601

#2 robtheblob

  • Members
  • 1 posts

Posted 24 September 2009 - 04:40 PM

This would be extremely handy as I have SmartFTP pulling files to a directory on a server for a "not too bright user" (NTBU) to grab the latest files with various names from the previous day and then import them into an accounting program.

I ONLY need the "end of day".csv file to be pulled from the FTP site (the peeps at the FTP site NEVER delete any files).

So what happens at the moment is the NTBU has to "find" the newest files amongst all the files that get pulled down from the FTP site (which is ALL the files with wildcard.csv names) instead of ONLY the files that are younger then 24 hours.

When NTBU has exported the file to the accounting program, they then move it to a "Completed" folder, thus leaving the FTP receive folder empty.

At the moment, EVERY *.csv is coming down, EVERY day, and the NTBU is whining about it (yes, I've told them how to sort by date and only pull "yesterdays" folder over), but they still complain.

I don't want to have to start scripting a "DEL *.csv > 24 hours" or a "diff <ftp receive> <completed>" type scripts, as the user wants to be able to move the *.csv files when they have finished importing them.

HELP please guys ... really need a Filter by time added ...



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users