Skip to content

Inconsistent parsing of narration field with respect to generating tags #1557

Open
@mondjef

Description

In my csv importer, if I import the following record:
02/18/2023,RETAILER #89 TORONTO ON,92.78,

I get the following entry..

2023-02-18 * "RETAILER #89 TORONTO, ON"
  Expenses:Someaccount
  Assets:BankAccount                       -92.78 CAD

Which is ok...however if I import the same record and add a tag (or make any other edit) to the narration field during the fava import process things change. For example if I add the tag '#test' I now get the following:

2023-02-18 * "RETAILER NEPEAN ON" #89 #test
  Expenses:Someaccount
  Assets:BankAccount                       -92.78 CAD

What I would like is that the #89 (store number/identifier) to not be parsed as a tag but I get that the fava process does not know what is a real tag versus one that should be not considered a tag. I had thought maybe I could circumvent this by simply escaping the # but this is not a great way to do it. Using \ results in \ in my beancount file which then has downstream consequences and I also noticed that inserting a single space after the # also prevents it being parsed as a tag but again it does leave the narrative intact as read from csv which is what I would like.

I think the fava process that parses this string should only parse and collect tags starting from the end of the string and stop when it encounters a non-tag token. This would prevent the issues I am noticing and would also make consistent regardless if the narrative text was modified or not.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions