Removes all events preceeding a given year from an .ics calendar file (the kind you can find e.g. in a Radicale-based CalDAV server).
./trim-calendar.sh Personal 2016 # removes all events starting before the year 2016 from the calendar stored in Personal.ics file
If you're using MacOS then you will need to
brew install coreutils
and changecsplit
on line 19 togcsplit
, otherwise you will see acsplit: *}: bad repetition count
error.Additionally, you will need to change
sed
on line 30 togsed
.