Well I'm working on parsing iCal (.ics) files...
Here's what I've got so far, but there are a couple of things that don't work right
Macro
out
str s.getfile("$desktop$\Schedule.ics")
s.findreplace("[] ")
ARRAY(str) arr = s
for(int'i 0 arr.len)
,ARRAY(str) arr1
,tok(arr[i] arr1 -1 ":")
,sel arr1[0]
,,case ["BEGIN"]
,,for(int'i2 0 20)
,,,ARRAY(str) EVENT
,,,tok(arr[i+i2] EVENT -1 ":")
,,,,sel EVENT[0]
,,,,,case ["END"]
,,,,,out arr[i+i2]
,,,,,break
,,,,,case else
,,,,,_s.from(EVENT[0] ":" EVENT[1]) err
,,,,,out _s
,,out "-----"
I can't figure out how to use this section for example:
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=First Last;X-NUM-GUESTS=0:mailto:jimmyvig@gmail.com
Format changes for the above bit that I can't figure out how to account for.
Also the the beginning doesn't parse well because the way case ["END"] works:
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Calendar Name
X-WR-TIMEZONE:America/Chicago
BEGIN:VTIMEZONE
TZID:America/Chicago
X-LIC-LOCATION:America/Chicago
BEGIN:DAYLIGHT
TZOFFSETFROM:-0600
TZOFFSETTO:-0500
TZNAME:CDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
Thanks for help,
Jimmy Vig