I am looking for some calendar software where I can input the
"weekday" and a "date number" and the software then tells me which
months that date fell on that weekday?
For example, if I provided this info: "Friday the 9th in 2004"
then the software would tell me "January, April and July".
GCal can do this. But beware, it has a very exhaustive syntax. You
get this program here:
http://gnuwin32.sourceforge.net/packages/gcal.htm
If you look at the GCal command line syntax you see this:
gcal [ [option . . . ] [%date] [@file . . . ] ] [command]
If not told otherwise GCal works with the current date in mind.
For this date it pops up calendar sheets, gives you a list of
appointments, evaluates holiday lists, and so on.
Nothing of this will help you much with Fridays in 2004. The %date
parameter makes GCal operating as if today would be another day.
That's, too, not what you'd like to achieve. The @file parameter
only feeds GCal with script files. That's too complicated for your
simple task.
The command parameter, OTOH, permits you to evaluate expressions
defined via 'options' and resource files for specific combinations
of years and months. That's better, isn't it? ;-)
In your case a simple command '2004' will do. To define a span of
years you could use '2002+2004' (that's 2002 up to 2004) or a
list of years like this: '2002;2003;2006'. If you need to select
(spans or lists of) months, too, please consult the docs.
Now we have GCal looking at the time frame we want it to. Next
step is to decide the operation mode. We would like neither some
calendar sheet output nor some date based appointment evaluation.
In fact: We want something which GCal calls 'Fixed date list'.
Therefore our first option is -u (= don't display calendar sheets).
The second option tells GCal to accept a date formula from
command line rather than from resource files (the default).
It's the -# option followed by a string in quotation marks.
If you don't like the subheaders of the output you may include
the -x option as well.
Now to the date formula. Because the target year is already
set as a command (in fact: is has to), the formula can be a
very universal one.
We tell GCal to scan through arbitrary years (= 0 [you could
replace that by 2004 if you better like that]) from first
Friday (= *d1fri) to the last (= #99fri) in steps of 7 days
(= .7). Moreover we only want days included (= %i), which
have any year (= 0000), any month (= 00) and only 9 as a
date (= 09). To finish the include span (= #) we add the
same date (= 00000009) once again.
The whole command line looks those:
gcal -# "0*d1fri#99fri.7 %i00000009#00000009" -u -x 2004
Output redirection (append: > Fri09.txt) sends the results
to (at this example) Fri09.txt.