Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv rules: support easy negation of conditions #2054

Open
simonmichael opened this issue Jun 28, 2023 · 1 comment
Open

csv rules: support easy negation of conditions #2054

simonmichael opened this issue Jun 28, 2023 · 1 comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. csv The csv file format, csv output format, or generally CSV-related.

Comments

@simonmichael
Copy link
Owner

https://hledger.org/dev/hledger.html#matchers : "There's not yet an easy syntax to negate a matcher." We should have this, for if blocks (and possibly if tables ?)

@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. csv The csv file format, csv output format, or generally CSV-related. labels Jun 28, 2023
bobobo1618 added a commit to bobobo1618/hledger that referenced this issue Sep 17, 2023
bobobo1618 added a commit to bobobo1618/hledger that referenced this issue Sep 17, 2023
bobobo1618 added a commit to bobobo1618/hledger that referenced this issue Sep 17, 2023
simonmichael pushed a commit that referenced this issue Oct 5, 2023
@simonmichael
Copy link
Owner Author

simonmichael commented Feb 15, 2024

Since 1.32 you can negate a matcher by prepending !, but it's unfinished:

Combining matchers

When an if block has multiple matchers, they are combined as follows:

  • By default they are OR'd (any one of them can match)
  • When a matcher is preceded by ampersand (&) it will be AND'ed with the previous matcher (both of them must match)
  • Added in 1.32 When a matcher is preceded by an exclamation mark (!), the matcher is negated (it may not match).

Currently there is a limitation: you can't use both & and ! on the same line (you can't AND a negated matcher).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. csv The csv file format, csv output format, or generally CSV-related.
Projects
None yet
Development

No branches or pull requests

1 participant