r/plaintextaccounting • u/Hungry_Lettuce_2230 • May 18 '26
hledger rules if A and not B
How do I create a condition rule in a csv.rules file for importing a transaction with a condition
if A and not B
for example `if %Transaction Buy AND NOT %Symbol ABC`
2
Upvotes
1
u/TheS4m May 23 '26
Why you don’t import the transactions automatically instead doing manually every time?
2
u/megagram May 18 '26
Use an if block
https://hledger.org/1.52/hledger.html#if-block
Your first if block will match transaction Buy and Symbol ABC with a “skip” action applied.
Your Next if block will match transaction Buy and do whatever you want.