Red S wrote:
...
> You can split your description field into the type for the first 3 words 
> (if that's valid), and then use the remaining for the memo (or throw it 
> away). It'll look something like this (untested code!):
>
> rdr = rdr.capture('Description', '(?:\\s)(?:\\w*)(.*)', ['type', 'memo'])
...

  in the end that approach didn't do what i needed for it to do
so i ended up using the following:

        rdr = rdr.sub('DESCRIPTION',
            '^Bought.*', 'Bought', count=1)
        rdr = rdr.sub('DESCRIPTION',
            '^CASH ALTERNATIVES DIVIDENDS \(.*',
            'CASH ALTERNATIVES DIVIDENDS (ticker)', count=1)


and so the lines up above in the map becomes the more simple:

            'Bought':                                   'buystock',
            'CASH ALTERNATIVES DIVIDENDS (ticker)':     'dividends',
            'CASH ALTERNATIVES DIVIDENDS':              'dividends',


  the DESCRIPTION field/column is my type.

  and that approach let me get all the lines in my files scanned,
the output is not right and looks horrible, but at least they all
scanned without errors.  :)  [it's my first batch of about 20 files
some of which i typed in a long time ago and others that were
downloaded as soon as i figured out how to get csv files.  i have
a bunch of other records that i've typed into a different format
that i will eventually want to massage and get fed into my ledger
for historical information but that's not going to happen for 
some time yet.]

  since there are many things i do not do (i don't do options or
margins or mutual funds) so i'm sure there are many transaction
types i've not seen in my history so those are going to have to
be figured out by someone else sometime.  but i have a working
framework now.


  on to the next question!

  i copy the DESCRIPTION to another column but how do i get 
fields put in the transaction description?  currently it looks
like:

2001-10-29 * "transfer" "[MMDA1] TDAmeritrade MMF"
  Assets:SB:TDA:MMDA1          1.51 MMDA1
  Assets:SB:TDA:Pass-Through  -1.51 MMDA1

2001-10-29 * "transfer" "transfer"
  Assets:SB:TDA:CASH           0 USD
  Assets:SB:TDA:Pass-Through  -0 USD

2001-10-29 * "income" "[MMDA1] TDAmeritrade Money Market Fund"
  Assets:SB:TDA:CASH                4.54 USD
  Income:SB:TDA:MM:Interest:MMDA1  -4.54 USD

  i know i'm missing some other things which aren't working quite
right yet, but just to get the information put in the ledger
as metadata but also on the description part of the line would 
be good.  it would help me further along, before i start digging 
into some other things and probably easier on my brain tonight.  :)

  once i get a cleaner version with more bugs sorted out i'll
post a link to it.


  fin

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" 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/beancount/0n1maj-5nl.ln1%40anthive.com.

Reply via email to