[Remind-Fans] remind2iCalendar
Anthony Chivetta
coolhoot at charter.net
Fri Jun 9 22:05:12 EDT 2006
My mother uses iCal on her mac and I wanted some way to have her subscribe to my
calendar in Remind, so I wrote a simple awk script to convert the output from
`remind -s` to the iCalendar format. It works for me, but your mileage may
vary. I know nothing about awk (this was my first attempt to write an awk
program), so I don't know how helpful I can be if anyone has problems using it,
but I can try. I have attached the script.
--
Anthony Chivetta
-------------- next part --------------
#!/usr/bin/awk -f
# rem2ics by Anthony J. Chivetta <achivetta at gmail.com>
# version 0.1 - 2006-06-09
# Converts output of remind -s to iCalendar
# usage: remind -s | rem2ics
#
# THE FOLLOWING CODE IS RELEASED INTO THE PUBLIC DOMAIN
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
BEGIN {
print "BEGIN:VCALENDAR"
print "VERSION:2.0"
}
{
gsub("/","",$1)
print "BEGIN:VEVENT"
if ($5 != "*"){
printf("DTSTART:%dT%02d%02d00\n",$1,$5/60,$5%60)
printf("DTEND:%dT%02d%02d00\n",$1,$5/60+$4/60,$5%60+$4%60)
print "SUMMARY:" substr($0,match($0,$7))
} else {
printf("DTSTART:%d\n",$1)
print "SUMMARY:" substr($0,match($0,$6))
}
print "END:VEVENT"
}
END {print "END:VCALENDAR"}
More information about the Remind-fans
mailing list