Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tkremind .reminders to .ics format

125 views
Skip to first unread message

The Real Bev

unread,
Nov 18, 2014, 7:51:23 PM11/18/14
to
I've been using tkremind since 1998. The .reminders file it generates
can't be converted by using the rem2ics
<http://wiki.43folders.com/index.php/Rem2ics> script supposedly designed
to do that. Sample .reminders entries:

REM TAG TKTAG1 17 August 2004 MSG Schiff Pix 12:00
REM TAG TKTAG2 30 August 2004 MSG Pritchard 1:00
REM TAG TKTAG3 30 August 2004 MSG Sonus 2:00
REM TAG TKTAG1 14 August 2004 MSG Davis
REM TAG TKTAG1 20 August 2004 MSG 8:00 Dr. Stewart
REM TAG TKTAG1 1 September 2004 MSG 10:30 Stewart

REM 9 August MSG Emma's birthday
REM 19 August MSG Ruby's birthday

and other variants.

For a while it was adding 3 lines of extranea for each entry, but I
removed that instruction.

I've tried editing bits of the .reminders file to make them look as
"normal" as possible, but the script-generated file is rejected by
google calendar.

Sample generated by the script:

BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
DTSTART:0T000000
DTEND:0T000000
SUMMARY:93
END:VEVENT
BEGIN:VEVENT
DTSTART:0T000000
DTEND:0T000000
SUMMARY:1963
END:VEVENT
BEGIN:VEVENT
DTSTART:0T000000
DTEND:0T000000
SUMMARY:97
END:VEVENT
BEGIN:VEVENT
DTSTART:0T000000
DTEND:0T000000
SUMMARY:REM 28 March MSG John's birthday
END:VEVENT
BEGIN:VEVENT
DTSTART:0T000000
DTEND:0T000000
SUMMARY:1939
END:VEVENT
BEGIN:VEVENT
DTSTART:0T000000
DTEND:0T000000
SUMMARY:REM 29 May MSG Bill's birthday
END:VEVENT
...

Google calendar error message:

Processed zero events.
Failed to import events: Unable to process your iCal/CSV file..

I've got 2900 entries, far beyond what I'm willing to edit by hand. Is
there any hope?


--
Cheers, Bev
========================================================
If I gave a shit, you'd be the first one I'd give it to.


Grant

unread,
Nov 18, 2014, 10:17:54 PM11/18/14
to
Hi,
Forgive the top post. Show small example input and desired output,
I'll take a look since it's an awk script. Also post to comp.lang.awk?

Grant.

The Real Bev

unread,
Nov 20, 2014, 2:23:30 AM11/20/14
to
On 11/18/2014 07:17 PM, Grant wrote:
> Hi,
> Forgive the top post. Show small example input and desired output,

Not a clue about what google wants. Somebody said it was supposed to be
an ical file, so I trusted the script to do it right. No idea what
that's supposed to be either.
'''
OK, I looked here http://en.wikipedia.org/wiki/ICalendar

I'm sorry to say that I just don't want it enough to deal with all that,
so you shouldn't either. I had hoped it was simple :-(

> I'll take a look since it's an awk script. Also post to comp.lang.awk?

See above. Thanks for thinking about it!
--
Cheers, Bev
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Warning -- Driver carries less than $20 worth of ammunition

Rinaldi J. Montessi

unread,
Nov 20, 2014, 9:29:22 AM11/20/14
to
The Real Bev decreed, Read These Runes!:
> On 11/18/2014 07:17 PM, Grant wrote:
>> Hi,
>> Forgive the top post. Show small example input and desired output,
>
> Not a clue about what google wants. Somebody said it was supposed to be
> an ical file, so I trusted the script to do it right. No idea what
> that's supposed to be either.
> '''
> OK, I looked here http://en.wikipedia.org/wiki/ICalendar
>
> I'm sorry to say that I just don't want it enough to deal with all that,
> so you shouldn't either. I had hoped it was simple :-(
>
>> I'll take a look since it's an awk script. Also post to comp.lang.awk?
>
> See above. Thanks for thinking about it!

This looked pretty straight forward:

> http://wiki.grahamenglish.net/index.php/Remind_Scripts#Convert_Remind_to_iCal

No?

--
Nothing astonishes men so much as common sense and plain dealing.

Grant

unread,
Nov 20, 2014, 3:08:53 PM11/20/14
to
On Wed, 19 Nov 2014 23:23:28 -0800, The Real Bev <bashl...@gmail.com> wrote:

>On 11/18/2014 07:17 PM, Grant wrote:
>> Hi,
>> Forgive the top post. Show small example input and desired output,
>
>Not a clue about what google wants. Somebody said it was supposed to be
>an ical file, so I trusted the script to do it right. No idea what
>that's supposed to be either.
>'''
>OK, I looked here http://en.wikipedia.org/wiki/ICalendar
>
>I'm sorry to say that I just don't want it enough to deal with all that,
>so you shouldn't either. I had hoped it was simple :-(

You're right, and it's not an itch I want to scratch. All that upper case
reminds me of BASIC, which I tore myself away from in the '80s ;o)
>
>> I'll take a look since it's an awk script. Also post to comp.lang.awk?
>
>See above. Thanks for thinking about it!

No worries.

Grant.

Grant

unread,
Nov 20, 2014, 3:12:07 PM11/20/14
to
Okay perhaps, if you like perl's write-only style ;o) I've written one
script in perl over the last decade, and that was because I needed
signals and forks. Awk is much easier for most text transformations.

Grant.
>
>No?

Mike Small

unread,
Nov 20, 2014, 5:47:13 PM11/20/14
to
Grant <o...@grrr.id.au> writes:

>>This looked pretty straight forward:
>>
>>> http://wiki.grahamenglish.net/index.php/Remind_Scripts#Convert_Remind_to_iCal
>
> Okay perhaps, if you like perl's write-only style ;o) I've written one
> script in perl over the last decade, and that was because I needed
> signals and forks. Awk is much easier for most text transformations.

And yet not so much easier that in this instance the Awk script actually
did the job. If Perl is as distasteful to her as it is you she can always
run it without looking at the code.

To dwell on this, I'm having trouble imagining how a line like the
following...

printf("DTEND:%dT%02d%02d00\n",$1,$5/60+$4/60,$5%60+$4%60)

... when done in Perl is going to be more "write only" or need even be
very different, for that matter, given that Perl has sprintf with the
same format specifiers. More than likely $1, $5, etc. would be replaced
with meaningful names or at worst guessable two letter combos.

The Perl script above is only harder to read in being longer but it's
doing a lot more checks and so on looks like (and perhaps it works). It
might be overkill, but rather than reinvent the parsing code, the author
could probably have taken the relevant Tcl out of the original tkreminder
program and embedded it in the Perl script using the Tcl module off CPAN,
writing it out using something else existing like CPAN's Data::iCalendar
(this is the same format?) with no need to write any code other than
glue. Awk is a different thing altogether now, then, isn't it? But maybe
it would be more fun doing it all yourself in the more primitive tool. I
know people who'd rather mess with sed's hold spaces for the mental
challenge of it rather than use something more functionally complete for
the purpose.

--
Mike Small
sma...@panix.com

The Real Bev

unread,
Nov 21, 2014, 3:33:06 AM11/21/14
to
On 11/20/2014 02:47 PM, Mike Small wrote:
> Grant <o...@grrr.id.au> writes:
>
>>>This looked pretty straight forward:

:-)

>>>> http://wiki.grahamenglish.net/index.php/Remind_Scripts#Convert_Remind_to_iCal

Just for kicks, I ran the sample script:
remind -s360 -irem2ics=1 ~/.reminders 1 Jan 1991 | TZ=PST8PDT rem2ics
-do >reminders.ics

which yielded

awk: /root/sbin/rem2ics:14: fatal: cannot open file `-do' for reading
(No such file or directory)

and a reminders.ics file containing only

BEGIN:VCALENDAR
VERSION:2.0

Then I saw this in the executable in /root/sbin:
# Converts output of remind -s to iCalendar
# usage: remind -s | rem2ics

This did nothing at all.

I then looked at the long script itself. No joy. Again, I implore you --

DON'T DO ANY MORE RESEARCH ON THIS. If I give up, so can you!
Cheers, Bev
===================================================
"I love deadlines... especially the whooshing sound
they make as they go by." -Douglas Adams

Rich

unread,
Nov 21, 2014, 5:53:40 AM11/21/14
to
The Real Bev <bashl...@gmail.com> wrote:
> On 11/20/2014 02:47 PM, Mike Small wrote:
> > Grant <o...@grrr.id.au> writes:
> >
> >>>This looked pretty straight forward:

> :-)

> >>>> http://wiki.grahamenglish.net/index.php/Remind_Scripts#Convert_Remind_to_iCal

> Just for kicks, I ran the sample script:
> remind -s360 -irem2ics=1 ~/.reminders 1 Jan 1991 | TZ=PST8PDT rem2ics
> -do >reminders.ics

> which yielded

> awk: /root/sbin/rem2ics:14: fatal: cannot open file `-do' for reading
> (No such file or directory)

Try this instead:

remind -s360 -irem2ics=1 ~/.reminders 1 Jan 1991 > /tmp/tempfile
and
TZ=PST8PDT rem2ics -do /tmp/tempfile > reminders.ics
or
TZ=PST8PDT rem2ics /tmp/tempfile -do > reminders.ics
or
TZ=PST8PDT rem2ics /tmp/tempfile > reminders.ics

The error message you received implies that "rem2ics" reads from a
file, not from the standard input.

The Real Bev

unread,
Nov 22, 2014, 2:47:26 AM11/22/14
to
On 11/21/2014 02:53 AM, Rich wrote:
> The Real Bev <bashl...@gmail.com> wrote:
>> On 11/20/2014 02:47 PM, Mike Small wrote:
>> > Grant <o...@grrr.id.au> writes:
>> >> Rinaldi wrote:
>> >>>This looked pretty straight forward:
>
>> :-)
>
>> >>>> http://wiki.grahamenglish.net/index.php/Remind_Scripts#Convert_Remind_to_iCal
>
>> Just for kicks, I ran the sample script:
>> remind -s360 -irem2ics=1 ~/.reminders 1 Jan 1991 | TZ=PST8PDT rem2ics
>> -do >reminders.ics
>
>> which yielded
>
>> awk: /root/sbin/rem2ics:14: fatal: cannot open file `-do' for reading
>> (No such file or directory)
>
> Try this instead:
>
> remind -s360 -irem2ics=1 ~/.reminders 1 Jan 1991 > /tmp/tempfile

OK, that created something that looks useful...

1991/01/25 * TKTAG13 * * Run update.named
1991/01/25 * TKTAG1 * * PacificAsia Museum free day
1991/01/27 * TKTAG3 * * Start a backup!
1991/02/01 * TKTAG13 * * Run update.named
1991/02/02 * * * * GROUNDHOG DAY
1991/02/03 * TKTAG3 * * Start a backup!
1991/02/04 * * * * Huntington
1991/02/04 * TKTAG2 * * John's birthday
1991/02/05 * * * * NatHist 10:
1991/02/05 * * * * TarPits 10:
...

Google calendar wouldn't import it, but I suspect I can tweak it in some
way... Maybe... Tomorrow...

> and
> TZ=PST8PDT rem2ics -do /tmp/tempfile > reminders.ics
> or
> TZ=PST8PDT rem2ics /tmp/tempfile -do > reminders.ics
> or
> TZ=PST8PDT rem2ics /tmp/tempfile > reminders.ics
>
> The error message you received implies that "rem2ics" reads from a
> file, not from the standard input.

I would have thought that that's what I wanted -- to convert my entire
.reminders file to .ics format.

--
Cheers, Bev
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Some people are alive only because it is illegal to kill them."
-- Lionel

Rich

unread,
Nov 22, 2014, 10:09:25 AM11/22/14
to
Except the above is not what Google is expecting. It is some
intermediate format.

> > and
> > TZ=PST8PDT rem2ics -do /tmp/tempfile > reminders.ics
> > or
> > TZ=PST8PDT rem2ics /tmp/tempfile -do > reminders.ics
> > or
> > TZ=PST8PDT rem2ics /tmp/tempfile > reminders.ics
> >
> > The error message you received implies that "rem2ics" reads from a
> > file, not from the standard input.

> I would have thought that that's what I wanted -- to convert my entire
> .reminders file to .ics format.

Yes, but you were piping ("|") the two together in your original post.
If that was the correct command pair, it meant you wanted the output of
the first to feed into the input of the second.

But the error message you got, from the second command, implied it did
not want to read from a pipe, but from a file.

So I suggested you instead feed the output of the first into a file,
then feed that file into the second program.

If "rem2ics" does all the work, then what was the first remind command,
and the the pipe, supposed to do?

The Real Bev

unread,
Nov 23, 2014, 1:49:43 AM11/23/14
to
I looked at the source of the google calendar page and was not
enlightened. I'll think about this tomorrow at Tara...

>> > and
>> > TZ=PST8PDT rem2ics -do /tmp/tempfile > reminders.ics
>> > or
>> > TZ=PST8PDT rem2ics /tmp/tempfile -do > reminders.ics
>> > or
>> > TZ=PST8PDT rem2ics /tmp/tempfile > reminders.ics
>> >
>> > The error message you received implies that "rem2ics" reads from a
>> > file, not from the standard input.
>
>> I would have thought that that's what I wanted -- to convert my entire
>> .reminders file to .ics format.
>
> Yes, but you were piping ("|") the two together in your original post.
> If that was the correct command pair, it meant you wanted the output of
> the first to feed into the input of the second.
>
> But the error message you got, from the second command, implied it did
> not want to read from a pipe, but from a file.
>
> So I suggested you instead feed the output of the first into a file,
> then feed that file into the second program.
>
> If "rem2ics" does all the work, then what was the first remind command,
> and the the pipe, supposed to do?

Not a clue, sorry! If I could answer that question I wouldn't have to
ask questions here :-(

--
Cheers, Bev
I have six locks on my door all in a row. When I go out, I lock
every other one. I figure no matter how long somebody stands there
picking the locks, they are always locking three.
0 new messages