On 16.09.10,08:10, David F. Skoll wrote: > Jostein Berntsen wrote: > > > Has anyone found a script or another way to sort the reminders file, so > > that all entries are sorted by date with the most recent at the end of > > the file? > > No, because except in the most simple cases, there's no defined sort > order for REM statements. For example, which comes first: > > REM [complex_function()] Tue OMIT Sat Sun MSG foo > REM Tue SATISFY [complex_function_2()] MSG bar >
A possible solution I tried out on the command line is this: sed -e '/^REM/s/\(.* .* \)\([0-9]\)\( .*\)/\10\2\3/g' ~/.reminders | \ awk 'NR > 20' | sort -n -k 4.4 -k 4.3 -k 3.1 -k 6.1 | sort -k2M | sed \ '/./!d' Assumes date entries as "22 Sep 2010" and LC_ALL=C. All special functions and calls are at the top of the file. Jostein _______________________________________________ Remind-fans mailing list [email protected] http://lists.roaringpenguin.com/cgi-bin/mailman/listinfo/remind-fans Remind is at http://www.roaringpenguin.com/products/remind
