[Remind-Fans] Parsing Remind's "-s" Simple Output

Anthony Chivetta achivetta at gmail.com
Tue Oct 17 14:03:07 EDT 2006


* Mike Harris <mjharris-lists at rcn.com> [2006-10-17 11:46:56 -0400]:

> I'm seeking some help with what I expect is simple text manipulation ... but nevertheless some skills that are -slightly- above my head right now.
> 
> Remind's -s flag returns events in this format (for me):
> 
> YYYY-MM-DD * * * * Event description.
> 
> I'd like to be able to parse this into:
> 
> MM-DD Event description.
> 
> Additionally, the -s flag returns events for the whole week; I'd like to remove listings from there that have already passed.
> 
> The reason?  Well, my normal 'remind' operation gives me essentially "the day's briefing," but I'd also like to have a look ahead, under a separate command, which I'm going to pipe to my desktop using GeekTool in small print.
> 
> So, essentially, I'm looking for help:
> 
> (1) Removing the first five characters of each line.
> 
> (2) Removing the " * * * *" from the line.
> 
> (3) Removing lines from the output that are in the past.
> 
> Would anyone have any input on this?
> 
> Much obliged in advance,
> 
> Mike Harris
> _______________________________________________
> Remind-fans mailing list
> Remind-fans at lists.whatexit.org
> http://lists.whatexit.org/mailman/listinfo/remind-fans
> 
rem -s | awk '{printf("%s ",$1); for(i=6;i<=NF;i++) printf("%s ",$i);printf("\n")}'|cut -c 6-

That should work for the text filtering, but the events that have already
passed part of it is not implemented there.  Some more awk magic should
be able to filter out dates before now().

Hope that helps.
-- 
Anthony Chivetta



More information about the Remind-fans mailing list