The input column represents the year without 201 and month and day without leading zeros. I must transform these into full date strings.
After a couple of hours to take step 1, I'm wondering if there is a more elegant way to achieve the steps left:
- Year: Find first first digit from left: Append 201 before (done)
- Month: Find 5th digit from 1 to 9: Append a 0 before
- Day: Find last digit from right which is between 1 to 9: Append a 0 after
- Insert hyphen after year, month and date
|-------+----------+------------|
| input | output | expected |
|-------+----------+------------|
| 9725 | 2019725 | 2019-07-25 |
| 811 | 201811 | 2018-01-01 |
| 71212 | 20171212 | 2017-12-12 |
|-------+----------+------------|
#+TBLFM: $2='(baz @0$1)
(defun baz (cell)
(concat "201" cell))
Explanation: The input represents the batch processing of approx. thousand grocery receipts. The goal was to hit as few key strokes as possible.