Remind -> Palm (naive way)
==========================
I'm still trying to find and ideal way how to get my calendar data into
the Palm. I'm still use on-line stuff (calendars from the OwnCloud and
the Google) which can be imported into "ical" format.
There is a "ical2rem" [1], [2] tool which allows to convert these data
to the format for the "remind" program. There used to be a program
called "rem2palm" but it is unavailable for ages (i only saw some
internet forums where it was discussed but no actual code).
So I have made something for myself. I don't understand Perl so I used
the AWK [4] (my AWK knowledge is very limited as you can see):
-----------------------------------------------------------------
#! /usr/bin/awk -f
BEGIN { }
{a = $1 ; c=$5 ; d=$6 ; $1=$2=$3=$4=$5=$6="" ; b = $0 ;
e=d ;gsub(":","",d); gsub("am","",d) ;
if (c < 480){c = c/60*100} else {c="130"} ;
if (match(d, /pm/)>1) {gsub(":","",d); gsub("pm","",d) ; d=d+1200; };
print a," ",d" GMT+100 \t", a," ",d+c" GMT+100 \t \t"b}
END { }
-----------------------------------------------------------------
I call the script "rem2palm". The strange "if (match())" stuff is used
because remind -p produces times like 11:33pm but the "pilot-xfer"
tools (the "install-datebook" in particular) wants to use format "2333"
instead. The "GMT+100" means "GMT + one hour" and you probably want to
change it to your local settings.
The "if (c < 480)" is my trying to fix the "ical2rem" script behaviour
(it puts strange values into the field where should be duration in
minutes).
It should be used in this way:
-----------------------------------------------------------------
remind -p .reminders |grep -v "\#" | rem2palm | grep -v "^[A-z]"|tee calendar.txt
install-datebook /dev/ttyf2 calendar.txt
-----------------------------------------------------------------
The "grep" is necessary to remove some failed conversions.
Well, it is a half-baken solution to copy stuff from on-line calendars
to the Palm. You will probably find many cases when this way does not
work (for example, when a description starts with number). It also does
not support events without time.
References:
[1]
https://www.roaringpenguin.com/wiki/index.php/ICal2Rem
[2]
http://wiki.grahamenglish.net/index.php/Ical2rem.pl
[3]
https://www.roaringpenguin.com/products/remind
[4]
https://en.wikipedia.org/wiki/AWK