diff options
| author | Lukasz Kasprzak <lukasz@arcofasiagroup.com> | 2026-08-21 09:51:36 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukasz@arcofasiagroup.com> | 2026-08-21 09:51:36 +0200 |
| commit | 147932ae2da02b5eceb6be6e1d704e1199bcb72e (patch) | |
| tree | 8d6d622551e012ac42598c2d9d96006417496d33 /README.md | |
| parent | 7459e218fa8b5b86c059762519447cb8863d3e75 (diff) | |
| download | colitur-x-147932ae2da02b5eceb6be6e1d704e1199bcb72e.tar.gz colitur-x-147932ae2da02b5eceb6be6e1d704e1199bcb72e.zip | |
fix(colitur-x): detect the CSV header instead of assuming it
Skipping the first line unconditionally punished the obvious way to view
one month --
colitur emit --format csv ... | grep '^2027-04' | colitur-x
-- by silently eating 1 April, because grep had already removed the
header the program still expected. A filter is exactly what this program
should compose with.
A header is the line beginning 'date,'; anything else is a day. Verified
all three ways: full year with header 365 rows from 01-01, a grepped
month without header 30 rows from 04-01, and the old head -1 incantation
still 30 rows.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -12,8 +12,12 @@ Keys: arrows or `hjkl` move, `n`/`p` change month, `q` quits. It reads CSV on **stdin** and nothing else, so the shell decides what it shows. One month: - colitur emit --format csv --from 2027 --to 2027 \ - | { head -1; grep "^2027-04"; } | colitur-x + colitur emit --format csv --from 2027 --to 2027 | grep "^2027-04" | colitur-x + +The header line is detected rather than assumed, so filtering it away is +fine. An earlier version skipped the first line unconditionally, which meant +that pipeline silently dropped 1 April -- the program fought the obvious +filter instead of composing with it. Another language, or a local calendar: |
