CSV import
Benjamin Sperisen
lasindi at gmail.com
Tue May 29 07:49:08 EDT 2007
> goffice is already a dependency, for the graphing/charting of Gnome Office
> Graphing (GOG). Do you need a particular version?
I don't think I need a particular version, though I haven't tested it
(I am using 0.3.7). Below are the goffice includes the code makes, in
case any of those headers might cause version-specific problems.
#include <goffice/utils/datetime.h>
#include <goffice/utils/go-glib-extras.h>
#include <goffice/utils/go-locale.h>
#include <goffice/utils/go-format.h>
> Have you gotten in touch with any of the gnumeric developers about this? If
> you intend to modify gnumeric to fully factor out the code, the project just
> became a lot bigger. If you don't, then you've effectively snapshoted and
> forked that submodule, which is fine. Regardless, it seems like it be good
> to get their advice, if any.
Yes, I asked a Gnumeric developer about it who pointed me to two files
(stf-parse.c and stf-parse.h). I snapshotted the files from the source
code in the Ubuntu 7.04 repository, which is version 1.7.8.
The good news is that all it took to separate the files from the rest
of Gnumeric was commenting out a few Gnumeric-specific includes and
functions. The Gnumeric people did a pretty nice job of keeping the
code clean! After an hour or two of fiddling, I think I've figured out
basically how it works, and I've been able to put together a program
that can load a CSV file and produce a two-dimensional GPtrArray
containing all the cells as strings.
Now that I have code that can load CSV files, I think I can move to
the next phase: loading the files into GnuCash. I've been looking
through the code trying to figure out how to write an importer plugin,
but I'm a bit lost. Is there some documentation you could point me to
that explains how to write a plugin? All I really need is code that
adds a menu item for the importer and calls an event handler that I
can write; then I'll have the "glue" between the code I've got and the
rest of GnuCash.
> At some point in the next week or two, I'd like to see a 3..6-paragraph
> summary of your approach, now that you've gotten into it a bit.
Sounds good! I should have a clearer idea of what to do in the next
couple of days, once I've got the plugin in place, since I'll be able
to start building the GUI that calls the code from Gnumeric.
Benny
More information about the gnucash-devel
mailing list