...or maybe not. I was a bit quick there. It did not find tags without
value, but it found tags *without* exactly one character (which was all my
tags).
After a bit of fiddling I got it to work as I intended. After adding posts
for some hours, the brain fog began to set in ;-).
But this seems to work if I add this to each account definition I check the
tag on:
account Foo
note The foo account
alias bar
check has_tag('baz')
check tag("baz") !~ /^$/
fredag 26 maj 2023 kl. 16:46:02 UTC+2 skrev [email protected]:
> Yes, it works. Thanks, Martin.
> I found 19 lines with missing tag values in the first file I tried it on.
> If the tag is missing a value the pivot doesn't show the correct value.
> I use the tags with --pivot <tag_name> on an account. Instead of adding
> more accounts, just add a tag and use --pivot.
>
> If I use it when I declare an account or a tag (check), I don't have to
> remember to add it on the command line.
>
> fredag 26 maj 2023 kl. 10:56:40 UTC+2 skrev Martin Michlmayr:
>
>> * [email protected] <[email protected]> [2023-05-26 01:14]:
>> > This works fine if you check for a specific tag value, but it doesn't
>> work
>> > if you want to check for a tag without a value. check value != "" ,or
>> check
>> > value != '' or a similar regex don't raise any warnings.
>> >
>> > Is there a way to check if a tag has no value?
>>
>> This works for me:
>>
>> -l 'has_tag("foo")' -l 'tag("foo") !~ /./'
>>
>> --
>> Martin Michlmayr
>> https://www.cyrius.com/
>>
>
--
---
You received this message because you are subscribed to the Google Groups
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ledger-cli/110cdec5-0a70-44a0-a981-342e7c155d49n%40googlegroups.com.