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

convert tsv quicken reports to json lines with invisible XML #37

Open
5 tasks
dckc opened this issue Dec 30, 2022 · 1 comment
Open
5 tasks

convert tsv quicken reports to json lines with invisible XML #37

dckc opened this issue Dec 30, 2022 · 1 comment

Comments

@dckc
Copy link
Owner

dckc commented Dec 30, 2022

As noted in the 2006 item, I have years of data in this tab-separated format; for example:

3/28/08	D0962	            S	STAPLES 00108084 ANKENY IA	Canon Powershot SD	Stuff:Major:AV	R	-249.99

I played with invisible XML and its playground and turned that into...

<tx num="S">
   <date month="3" day="28" year="08"/>
   <account>D0962</account>
   <description>STAPLES 00108084 ANKENY IA</description>
   <split status="R">
      <memo>Canon Powershot SD</memo>
      <category>Stuff:Major:AV</category>
      <amount>-249.99</amount>
   </split>
</tx>

using...

tx: date, account, @num, description, split.

split: memo, category, @status, amount.

date: @month, -"/", @day, -"/", @year, tab.
month: ["0"-"9"]+.
day: ["0"-"9"]+.
year: ["0"-"9"]+.

account: field, tab.
num: -space?, field, tab.
description: field, tab.

memo: field, tab.
category: field, tab { TODO: split on : ? }.
status: field, tab.
amount: field { TODO: constrain to number syntax? }.

-field: ~[" "], (~[#9])*. { don't start with space to avoid ambiguity in num }
-tab: -#9.
-space: -[" "]+.

TODO:

  • handle >1 tx
  • handle >1 split
  • write JSON lines instead of XML
  • find a simple implementation, preferably by aggressively pre-compiling
    • perhaps just use this as a spec for a hand-rolled parser
@dckc
Copy link
Owner Author

dckc commented Dec 30, 2022

p.s. I had a hard time finding my earlier implementation: trxtsv.py d5b0312 2008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant