Loading existing tables of data into ghini

4 views
Skip to first unread message

Corrado Topi

unread,
Jun 5, 2018, 5:57:47 PM6/5/18
to bau...@googlegroups.com
Dear all,

Two unskilled users would need to load several tables like the one below attached into ghini. Anyone who knows how to do it and could suggest a quick and simple approach?

Best Regards

Corrado
roses.csv

Mario Frasca

unread,
Jun 5, 2018, 7:33:53 PM6/5/18
to ghini/bauble
trusting that you are skilled enough to help the two unskilled users, I would suggest you have a look at scripts/csv2json.py

it is a script I've been editing and re-editing, trying to add flexibility in the process.  I use it to convert csv files into ghini's importable json format, whenever the amount of data is more than a few tens rows.  below fifty, I guess it's faster inserting by hand.  but even above fifty, I'm not sure what is the best approach, I sometimes review and edit that script, sometimes I just write a small sed script to do the conversion, but in this case I generally write a different sed script for a different set of fields from the same file, as many scripts as the target tables.

importing from json is very flexible, not fast, but flexible.

if you need an idea of the target format, (1) create some scratch data in ghini, (2) export in json format, (3) study the result, (4) make sure you're including the kind of data you want to import, and proceed by trial and error, until you have imported all relevant fields.

solving this in a generic form is a long-open issue, no less than December 17, 2015:
all that's written there will help you understand what I mean with the above text.

let us know how you manage, I can assist you on the details, but I'm quite busy on other stuff, so don't ask too much please.
:-)

ciao,
Mario
Reply all
Reply to author
Forward
0 new messages