QIF/CSV import date parsing code

Derek Atkins warlord at MIT.EDU
Tue Jul 10 19:14:22 EDT 2007


"Benjamin Sperisen" <lasindi at gmail.com> writes:

> So, if you've already started on one, just tell me and I'll start
> tracking it. If not, is it alright with you if I write it? It would
> probably have a prototype like:
>
> time_t gnc_parse_date(char* str, int format);
>
> where format is in an enumeration containing the formats d-m-y, m-d-y,
> y-m-d, and y-d-m. (See Derek's email for how it would work:
> https://lists.gnucash.org/pipermail/gnucash-devel/2007-July/020948.html)
> This does depend, however, on how big of a problem the issue Thomas
> raised is (https://lists.gnucash.org/pipermail/gnucash-devel/2007-July/020950.html).
>
> In any case, just let me know what you think.

I think you need two passes.  You need one pass to go through
the whole dataset and reduce the choices based on the data, then
if there's an ambiguity you should ask the user, and THEN you can
go and finish the parsing based on the user input (or go into
a CSV profile and check it from there).

If you have any questions even after my previous mail let me know
and I can go into more detail.

I think that this API is certainly reasonable for the second stage.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list