On a branching note, thinking about quick & dirty hacks for this type of tool, what is the current state/lack of state for the Sword library's python binding? I thought I remembered hearing someone speaking about it in the past, but I don't recall hearing much about it. It would seem an ideal way to achieve a decent RAD language for fast & simple hack-ups like this SQL importer.
Add to that the possibilities of XP development for various types of front-end, etc, etc... --Greg On 11/6/06, Troy A. Griffitts <[EMAIL PROTECTED]> wrote: > sorry, typo.... 'module' variable used below should be 'book', per the > name declared near the start. > > Troy A. Griffitts wrote: > > I'll leave the question alone as to the value of a relational database > > for this data over using the SWORD API. > > > > You can do this a few ways depending on your familiarity of tools. > > > > If you can process raw text files, you can use of one the SWORD provided > > export utilities to produce plain text data from a SWORD module: > > mod2osis, mod2imp. > > > > If you are familiar with programming you can use your favorite > > programming language and the SWORD bindings for such with a simple loop > > like: > > > > #include <swmgr.h> > > #include <swmodule.h> > > using namespace sword; > > > > SWMgr library; > > SWModule &book = *(library.getModuleByName("KJV")); > > const char *sql = "insert into bookdata (bookid, entrykey, entrydata) > > values (?, ?, ?)"; > > // "prepare" your sql statement > > for (book = TOP; !book.Error(); book++) { > > // sqlStatement.bind(1, "KJV"); > > // sqlStatement.bind(2, module.KeyText()); > > // sqlStatement.bind(3, module.getRawEntry()); > > // sqlStatement.execute(); > > } > > //sqlStatement.commit(); > > > > > > Hope this helps. Please consider using / contributing to the usefulness > > of the API itself to meet your purposes. I'm sure your additions would > > add to the usefulness of the project for many others after you. > > > > -Troy. > > > > > > > > > > lumin8 wrote: > >> I am interested transferring a couple of the Sword bible and lexicon > >> modules into a relational database (mysql most likely) for my own > >> indexing purposes. > >> > >> Is there already a tool available that can move the data over? If > >> not, what would be the best way of accomplishing this? > >> > >> Thanks so much, > >> nathan > >> > >> > >> ------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> sword-devel mailing list: sword-devel@crosswire.org > >> http://www.crosswire.org/mailman/listinfo/sword-devel > >> Instructions to unsubscribe/change your settings at above page > > > > > > _______________________________________________ > > sword-devel mailing list: sword-devel@crosswire.org > > http://www.crosswire.org/mailman/listinfo/sword-devel > > Instructions to unsubscribe/change your settings at above page > > > _______________________________________________ > sword-devel mailing list: sword-devel@crosswire.org > http://www.crosswire.org/mailman/listinfo/sword-devel > Instructions to unsubscribe/change your settings at above page > _______________________________________________ sword-devel mailing list: sword-devel@crosswire.org http://www.crosswire.org/mailman/listinfo/sword-devel Instructions to unsubscribe/change your settings at above page