I don't understand your question.
If you can post your example files, we can debug it.
If the regexp you doesn't match anything in your files, if won't match the
importer.
The matching code is here, add some printfs there:
https://bitbucket.org/blais/beancount/src/26f7bb21007f1fb49fdd23829470fc4df88a6d4c/beancount/ingest/importers/regexp.py?at=default&fileviewer=file-view-default#regexp.py-51




On Sun, Apr 22, 2018 at 3:46 PM, viq <vic...@gmail.com> wrote:

> On 18-04-08 17:01:48, Martin Blais wrote:
> > The CSV importer that is provided puts together a regexp from the list of
> > fields you provide.
> > This regexp is run against the contents of the files it is scanning, in
> > order to identify whether a particular importer should be able to
> process a
> > file.
> >
> > The regexp is built from the fields you provide, I think, for this
> > importer, it's in the source code.
> > You'll have to open up the source code to debug this, but I suspect your
> > list of fields may not exactly match that from your files.
> > (There ought to be better tools for debugging this, but because setting
> up
> > the import config usually requires coding, people just override methods
> and
> > put prints and debug it that way.)
>
> Sorry for long delay, I finally tried looking into this again.
> It seems like I'm severely misunderstanding something here. My importer
> init now looks like this:
>
>     def __init__(self, account):
>         csv.Importer.__init__(
>             self, self.config,
>             account, 'Currency',
>             ('Transaction Date,Posted Date,Description,Payee,'
>              'Payee account,Amount,Balance'),
>             1)
>         print("REGEXPS: {}".format(self.regexps))
>
> but what I'm seeing, makes no sense, I don't expect it to match anything
> ever, unless I'm misunderstanding how this works:
> $ PYTHONPATH=`pwd` bean-identify test.config.py bank_history_sample.csv
>
> REGEXPS: [('Transaction Date,Posted Date,Description,Payee,Payee
> account,Amount,Balance', re.compile('Transaction Date,Posted
> Date,Description,Payee,Payee account,Amount,Balance',
> re.IGNORECASE|re.MULTILINE|re.DOTALL))]
> **** /home/viq/Work/Own/beancount/bank_history_sample.csv
>
> --
> 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 beancount+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/20180422194611.z32tlg24bxpf27xk%40hirauchi.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhMjLJW51rkirAafbKLKA5-CZYY0bRczt1TfZmO9%2BtC93w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to