You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.csvThe csv file format, csv output format, or generally CSV-related.docsDocumentation-related.
UPDATE: It looks like this is issue with documentation that states that field is CSV field. In the real, it is some internal variable that is used to generate journal, so the field has to be from predefined set of fields. Documentation is confusing...
Thanks for the report. It sounds like you resolved the problem, and underscores in field names are not the cause ? Could you show in more detail where the doc is confusing ?
And, did you also figure out end and skip ? Please come to the hledger chat for support, we'll be able to help more there.
I think the underscore is not real cause but that error message was confusing. I think that only very limited set of variables could be used in if block statement, see "long error message". Doc is confusing in the point that it has information that variable is CSV field, I assumed it could be user defined CSV field, like "amount_in" or "contract" but that is not true, the variable has to be from the set of predefined variables, see long error that list them all.
end and skip are documented; I have not used them but these special variables are documented, no issue here...
I am sorry, I will be traveling for next two weeks and I could not join a chat, I will be busy with other topics.
No problem, thanks for the feedback. Wow yes that is a very long parse error message. And you're right, the doc for if tables is very confusing. I'll improve it.
Not just confusing but wrong, as you said. I have rewritten this and multiple other CSV topics, maybe now I'll get to use if tables myself. https://hledger.org/dev/hledger.html#if-table
simonmichael
changed the title
if block, field with underscore cannot be used in rule for CSV import
if tables require hledger field names, not csv field names
Jan 11, 2023
A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.csvThe csv file format, csv output format, or generally CSV-related.docsDocumentation-related.
I have field with underscore in the name, like
amount_in
. It works but I cannot use such field inif block
:When I try with
contract
, that is one of my CSV fields, I get this long error:UPDATE: It looks like this is issue with documentation that states that field is CSV field. In the real, it is some internal variable that is used to generate journal, so the field has to be from predefined set of fields. Documentation is confusing...
https://hledger.org/1.28/hledger.html#if-table
BTW, what are fields
end
andskip
? How to use them?? (It is explained in doc, in the same chapter, How CSV rules are evaluated)The text was updated successfully, but these errors were encountered: