theWord
https://forum.theword.net/

Merging two dictionaries
https://forum.theword.net/viewtopic.php?f=7&t=7399
Page 1 of 1

Author:  jonathangkoehn [ Sat Nov 18, 2017 2:12 am ]
Post subject:  Merging two dictionaries

Does anyone have some SQLite tips or code for merging two dictionaries into one.
For example I have a Spanish Vines in Hebrew and another in Greek and I'd like to merge them.

If possible I'd like to sort the topics list alphabetically at the same time. Since there are also some Spanish topics.

Thanks

Author:  JG [ Sat Nov 18, 2017 10:10 am ]
Post subject:  Re: Merging two dictionaries

You can do some of this within theWord. Have both modules as "user editable", then select all the topics in the one module and "drag n drop" to the topics list in the target module.
Then I would try some sql on the module either of these should do something, though I am just borrowing past code here.
Of course you should only try this on backup copies until you are sure all is well.

create table x (rel_order integer primary key autoincrement, id, subject);
insert into x(id,subject) select id,subject from topics order by subject;
update topics set rel_order = (select rel_order from x where id = topics.id);
drop table x;
vacuum;
---------------------------------
create table x (rel_order integer primary key autoincrement, id, subject);
insert into x(id,subject) select id,subject from topics order by lower(subject);
update topics set rel_order = (select rel_order from x where id = topics.id);
drop table x;
vacuum;

Page 1 of 1 All times are UTC + 2 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/