while true; do sleep 1; [[ m3-2018.txt -nt m3-2018.html ]] || continue; date; cat m3-2018.txt | grep -iE '^[\!789] |[^a-z]buy([^a-z]|$)|<.*[0-9 ]jpy' > m3-2018-shopping-list.txt; for fn in m3-2018 m3-2018-shopping-list; do { cat .m3.header; cat "$fn.txt" | sed -r 's@(.) ([^ ]*) *([^ ]*) *«(.*)» *(.*)@<tr><td>\1</td><td>\2</td><td>\3</td><td>\4</td><td>\5</td></tr>@;s@^ {8} *([^ ]) (.*)@<tr><td>\1</td><td></td><td></td><td></td><td>\2</td></tr>@' | grep -vE '^wget |^cat |^R Location'; cat .m3.footer; } > "$fn.html"; done ; done
