I gave in and adding some builtin functions to csv rules. Currently:
upper, lower, capitalize/capitalise, trim, negate, abs, concat, join, default, replace, substr
https://hledger.org/dev/hledger.html#functions
Also, rules can now reference the value of a hledger field; we can finally append to comments.
https://hledger.org/dev/hledger.html#referencing-other-fields
And a new keyword and whitespace friendliness for if tables:
https://hledger.org/dev/hledger.html#ifs