Skip to content

Docs: recipe for updating a CSV database file from a partial download (#826) - #2153

Merged
johnkerl merged 2 commits into
mainfrom
issue-826-csv-upsert-recipe
Jul 9, 2026
Merged

Docs: recipe for updating a CSV database file from a partial download (#826)#2153
johnkerl merged 2 commits into
mainfrom
issue-826-csv-upsert-recipe

Conversation

@johnkerl

@johnkerl johnkerl commented Jul 6, 2026

Copy link
Copy Markdown
Owner

#826

Adds a new section to the questions-about-joins page: updating a durable "database" CSV file from a periodic download that contains a subset of its records and a subset of its columns, with no new records or columns introduced.

The recipe hinges on join's collision rule -- on paired records, non-join field values from the right file overwrite those from the left file -- so the database goes on the left (-f) and the download on the right, with --ul passing through database records that received no update. The output schema then automatically matches the database file's columns and column order. Two variants are included:

  • then sort -t id to restore the original row ordering (paired records stream out in download order, unpaired ones after);
  • a --rp + put variant so that empty cells in the download leave the database values alone rather than blanking them out (a pitfall the issue reporter hit directly).

All examples are live GENMD samples verified against a fresh build, with two small new sample files docs/src/data/update-db.csv and docs/src/data/update-download.csv.

🤖 Generated with Claude Code

…#826)

Adds a section to the questions-about-joins page showing how to update
matching records of a durable CSV file from a download containing a
subset of records and a subset of columns, using join --ul with the
database as the left file (right-file values win on collision), plus
variants for restoring row order and for keeping database values when
the download has empty cells.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@johnkerl
johnkerl marked this pull request as ready for review July 9, 2026 19:18
…recipe

# Conflicts:
#	docs/src/questions-about-joins.md
#	docs/src/questions-about-joins.md.in
@johnkerl
johnkerl merged commit 806c51e into main Jul 9, 2026
10 checks passed
@johnkerl
johnkerl deleted the issue-826-csv-upsert-recipe branch July 9, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant