I managed to convert ' time
into a pipe character going from this…
2014/12/04 Test in 1 day' time 0 weeks
2014/12/07 Amazon Prime Ends in 95 days' time 13 weeks
2014/12/24 Christmas in China in 112 days' time 16 weeks
… to this…
2014/12/04 Test in 1 day | 0 weeks
2014/12/07 Amazon Prime Ends in 95 days | 13 weeks
2014/12/24 Christmas in China in 112 days | 16 weeks
… with the help of sed 's/. time/ |/'
.
The problem: I can't for the love of god figure out how to replace the in
string before days count, e.g. in XXX
with | XXX
. Obviously the number of days should be kept.
Goal:
2014/12/04 Test | 1 day | 0 weeks
2014/12/07 Amazon Prime Ends | 95 days | 13 weeks
2014/12/24 Christmas in China | 112 days | 16 weeks
For reference purposes: I'm trying to build a markdown table out of a remind
output via…
echo "| Date | Event | Days Until | ~Weeks |" && rem -n | sort | awk '{$0="| "$0};{$3="| "$3};{print $0" |"}' | sed 's/. time/ |/'