--explain)pipx install exform # or: uvx exform / pip install exform echo "1234567890" | exform -e "5551234567 => (555) 123-4567" (123) 456-7890
Every recipe below is the real tool output. You give a couple of before → after examples; exform figures out the rule and applies it to every line — no regex, no LLM, no API key.
$ cat names.txt | exform -e 'Doe, John => John Doe' -e 'Smith, Jane => Jane Smith' Doe, John Smith, Jane Turing, Alan John Doe Jane Smith Alan Turing
Two examples are enough — the third line was never shown to exform.
$ cat dates.txt | exform -e '2000-01-15 => 15/01/2000' -e '2024-07-04 => 04/07/2024' 2000-01-15 2024-07-04 1999-12-31 15/01/2000 04/07/2024 31/12/1999
$ cat emails.txt | exform -e 'ada@math.org => math.org' -e 'grace@navy.mil => navy.mil' ada@math.org grace@navy.mil math.org navy.mil
$ cat ids.txt | exform -e '5 => 00005' -e '42 => 00042' 5 42 1234 00005 00042 01234
$ cat phones.txt | exform -e '1234567890 => (123) 456-7890' -e '5559876543 => (555) 987-6543' 1234567890 5559876543 (123) 456-7890 (555) 987-6543
$ cat users.jsonl | exform --json-field user.name -e 'Doe, John => John Doe' -e 'Lovelace, Ada => Ada Lovelace' {"user": {"name": "Doe, John"}, "age": 41} {"user": {"name": "Lovelace, Ada"}, "age": 36} {"user": {"name": "John Doe"}, "age": 41} {"user": {"name": "Ada Lovelace"}, "age": 36}
Only the targeted field changes; every other key, nesting and type is preserved.
$ exform -e 'John,Doe,NYC => Doe John' -e 'Ada,Lovelace,London => Lovelace Ada' --emit awk awk -F, '{ print $2 " " $1 }'
exform infers the rule, then hands you awk you can paste anywhere — and it refuses to print an awk program that disagrees with your examples.
Install: pipx install exform · uvx exform · pip install exform — or grab the zero-dependency exform.pyz. Full cookbook in the README.