Page 1 of 1

Merging two dictionaries

Posted: Sat Nov 18, 2017 3:12 am
by jonathangkoehn
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

Re: Merging two dictionaries

Posted: Sat Nov 18, 2017 11:10 am
by JG
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;