Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


rkippen
2012-06-21T22:28:21Z
It would be nice to be able to use a dynamic file with a date as a condition.

E.g.

if File Exists C:\Archive\<YYYY>\<MM>\TheFilename_<YYYYMMDD>.txt

Anything in <angle brackets> is substituted with the current date.

In addition to this, it would be good to be able to offset the date value.

I've developed a token language that allows to dynamically offset a date. See attached file.



Sponsor
Forum information
trevinom
2012-07-12T17:59:10Z
rkippen
2012-07-12T18:56:23Z
Originally Posted by: trevinom 

where's the file?



Attached now. I've developed a simple way of expressing relative dates based on adjustment tokens and alignment tokens. The document does job of describing it. I also have some C# code if you want that. Let me know.
File Attachment(s):
Generic Date Equations.doc (35kb) downloaded 75 time(s).
trevinom
2012-07-12T19:31:45Z
That is some good stuff.
I've been having to do my own version of this that is not as 'user friendly' and very rudimentary.
Could you let me look at your c# code?

Thanks!!
rkippen
2012-07-12T19:41:48Z
Originally Posted by: trevinom 

That is some good stuff.
I've been having to do my own version of this that is not as 'user friendly' and very rudimentary.
Could you let me look at your c# code?

Thanks!!




See attached files. Renamed to ".txt" to upload.

When using generic dates that involve "business" days, you need to use a Calendar object to define what the holidays are. A simple "NoHolidayCalendar" has been attached as an example.
File Attachment(s):
Calendar.cs.txt (13kb) downloaded 56 time(s).
GDate.cs.txt (11kb) downloaded 53 time(s).
NoHolidayCalendar.cs.txt (1kb) downloaded 52 time(s).
trevinom
2012-07-12T20:05:24Z
that's some slick coding you got there.
very nice.
it would definitely make it alot easier to deal with scheduling if they would implement it in VisualCron.
Support
2012-07-12T21:53:51Z
Originally Posted by: rkippen 

It would be nice to be able to use a dynamic file with a date as a condition.

E.g.

if File Exists C:\Archive\<YYYY>\<MM>\TheFilename_<YYYYMMDD>.txt

Anything in <angle brackets> is substituted with the current date.

In addition to this, it would be good to be able to offset the date value.

I've developed a token language that allows to dynamically offset a date. See attached file.






If I understand you correctly you can already do this with VisualCron Variables like this:

C:\Archive\{DATEFORMAT(yyyy)}\{DATEFORMAT(MM)}\TheFilename_{DATEFORMAT(yyyyMM)}.txt
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
rkippen
2012-07-12T22:15:58Z
Originally Posted by: Support 



If I understand you correctly you can already do this with VisualCron Variables like this:

C:\Archive\{DATEFORMAT(yyyy)}\{DATEFORMAT(MM)}\TheFilename_{DATEFORMAT(yyyyMM)}.txt





That's neat. I'll give it a try. Although, would be cleaner as:

C:\Archive\<yyyy>\<MM>\TheFilename_<yyyyMM>.txt
(Windows doesn't allow angle brackets, so it's a good choice. Not sure about Linux or if VC supports Linux).

Thanks.
trevinom
2012-07-13T12:51:06Z
I was thinking in terms of offsetting date variables taking weekends, holidays and month/year boundaries into account.
I am currently having to put in logic, for instance, to get all the files in a directory that were created in the month of May to zip them up. You currently only allow ">" and "<" as the allowed operators. So, I can't get the stuff that was created on the 1st of the month and then I have to go to the following month and use the 1st day to get the right boundaries for this type of functionality.
Scroll to Top