Add to Claude

Guides · For agents

Find and replace many values at once with a lookup table

Tools: sift_fix_dry_run, sift_fix_apply, sift_fix_undoWorks with Claude Code

Give your agent a lookup table of old value to new value and ask it to run Sift's map_values fix on the column. Every exact match is replaced in one pass, and any value not in the table is flagged and left alone. In the test price list, 4 of 12 categories are replaced and 4 are flagged.

Ask your agent

With Sift connected (setup takes three steps), paste this and swap in your own paths.

Use Sift with /path/to/rules.prices.json on /path/to/price_list.csv. Dry run map_values on the category column with this table: CW to Cookware, cookware dept to Cookware, Gardening Stuff to Garden. Tell me what would change and what was flagged, then apply it if I say yes.

A third of the rows change, so the rules file's share-of-rows limit has to allow it. This one allows up to 40%: {"guardrails": {"stop_if_share_of_rows_changed_over": 0.4}}. With the usual 0.2, Sift stops before writing anything.

What Sift sends back

Values that would change4 of 12 (33.3%): CW to Cookware on 2 rows, cookware dept to Cookware on 1, Gardening Stuff to Garden on 1
Already a value the table writes4 (Cookware and Garden)
Flagged, not in the table4 (Tableware and Appliances), left as they were
After applyA new file, a receipt and a changes-only file. The original is not touched.
After undoThe original rebuilt, matching byte for byte

Matching is exact. hw, CW with a space after it, or H.W. would not match CW. There are no near matches and no case folding, so nothing is replaced by accident.

What to do next

Questions

Is the match case sensitive?
Yes. CW and hw are different values. List each spelling you want replaced.
Why flag values that aren't in the table?
So you see every value the table doesn't cover. Sift leaves them as they were rather than guess.
Does it work on an Excel file?
Fixes work on CSV, which is what makes the undo exact. Save the sheet as CSV first, then point your agent at the CSV.

One file, no agent? Clean a file by hand in your browser, with nothing uploaded.

More guides

Guide Standardize country names Guide Change a column's value where a condition is true Guide Change prices across a list, with a dry run and an undo