Guides · For agents
Find and replace many values at once with a lookup table
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
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
- Add the good values to the table as themselves (Tableware to Tableware, Appliances to Appliances). The same run then flags 0 and counts 8 as already fine.
- Keep the table for next time in the rules file's
value_maps, and ask for it by name withmapName. - If values carry stray spaces, run the trim fix first so they match the table.
Questions
Yes. CW and hw are different values. List each spelling you want replaced.
So you see every value the table doesn't cover. Sift leaves them as they were rather than guess.
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.