[www.theword.net]

Twitter live feed  
View unanswered posts | View active topics It is currently Fri Jun 23, 2017 2:02 am



Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
 How to edit non-Bible modules (.twm) 
Author Message
Site Admin

Joined: Tue Aug 29, 2006 2:09 pm
Posts: 8534
Location: Corfu, Greece
Post How to edit non-Bible modules (.twm)
This info applies to version 3.
All non-Bible modules have an extension .twm (TheWordModule). These files are sqlite3 database files.
To read more about the sqlite database see here: http://www.sqlite.org

To edit these files you may use any of the free editors that can work with sqlite files. Please, see list here: http://www.sqlite.org/cvstrac/wiki?p=ManagementTools

I personally use the following 3 programs to edit the .twm files:
1. http://www.sqliteexpert.com/ (Personal edition which is free)
2. http://www.singular.gr/sqlite/
3. http://www.yunqa.de/delphi/doku.php/products/sqlitespy/

Although i prefer the first one, the second provides unicode support. It seems that may be better tools that these, it's just a personal opinion.

Since the word 'database' seems to intimidate some people, let me write shortly what it is:
A database file is just a structured file that contains data organized in tables (columns and rows). In order to change the content of a database file, instead of using an editor, you can use a language that is called SQL. The tools above make it easy to give such commands in order to read or alter these files. You don't need to worry how the data are organized in the file itself, the tools above can show you these data in tabular format (something like excel).

The twm files contain a number of tables each where the actual data are stored. The structures are quite simple to understand. As an example, i will tell how you can add to a dictionary the flag that it is a strong dictionary.

All twm file contain a table called 'config'. This table contains 2 columns, one called 'name', the other called 'value'. As you can see, this is used to store parameters (name=value).
In order for a dictionary to be flagged as containing strong definitions, one row should be added with name=strong and value=1. To do that, you open the file with one of the tools and you just execute the following SQL command:
Code:
insert into config(name,value) values('strong',1);


In order to check all the values of this table, just write
Code:
select * from config;


For sqlite explorer: in order to execute one of these statements, you just type it and press Execute (F9). The result are shown below.

I hope this is clear, if not i can add more details,
Costas


Mon Nov 12, 2007 9:22 pm
Profile WWW
User avatar

Joined: Thu Dec 09, 2010 2:29 pm
Posts: 534
Location: Россия, Крым, Севастополь
Post Re: How to edit non-Bible modules (.twm)
how to work of field ''blob'' in ''content.data'' ?

_________________
«Мыши плакали, кололись, но продолжали жрать кактус»


Last edited by nikolay_l on Sun Mar 11, 2012 8:12 pm, edited 1 time in total.



Sun Mar 11, 2012 12:55 pm
Profile ICQ WWW

Joined: Mon Nov 02, 2009 1:43 am
Posts: 129
Location: Greenville, South Carolina
Post Re: How to edit non-Bible modules (.twm)
Costas,

Thank you so much for this information. The more information you can supply, in as basic terms as possible, the better those of us who are not familiar with SQL can work. For myself this is great! Thank you

_________________
Dave
Gods gifts comes wrapped many different ways.


Sun Mar 11, 2012 2:38 pm
Profile

Joined: Tue May 04, 2010 11:45 pm
Posts: 174
Location: Santiago, Chile
Post Re: How to edit non-Bible modules (.twm)
nikolay_l wrote:
how to work of field ''blob'' in ''content.data'' ?
Nikolai.
Quoting Costas.

In SQLite:
Code:
select ''||data from content;

This will format the blob as string and you will see it's content. Remember to convert the module to RTF first to be able to edit.

I think there is an ODBC driver for SQLite. Google it,

Hope this helps,
Manuel.

_________________
Awaiting the return of the Lord (The Glorious rapture of the Church)...

http://jesus-christ-is-coming.blogspot.com/
http://www.cristo-viene.cl


Mon Mar 12, 2012 7:32 pm
Profile
User avatar

Joined: Thu Dec 09, 2010 2:29 pm
Posts: 534
Location: Россия, Крым, Севастополь
Post Re: How to edit non-Bible modules (.twm)
thanks, - we will try it's understood


Mon Mar 12, 2012 9:13 pm
Profile ICQ WWW

Joined: Mon Mar 12, 2012 9:06 pm
Posts: 4
Post Re: How to edit non-Bible modules (.twm)
Hi guys.
I want read "data" column in "content" table.
I want to create a new database with modified data.

When I read data from this column I get string with not understand for me type.

How I know 'blob' type it's binary data storage, it's used for save text and pictures. I want know how can I read data, get text , get pictures or else.

For programming I use ruby on rails.


Mon Mar 12, 2012 9:18 pm
Profile
Site Admin

Joined: Tue Aug 29, 2006 2:09 pm
Posts: 8534
Location: Corfu, Greece
Post Re: How to edit non-Bible modules (.twm)
The actual content type in there is either 'rtf' or 'rvf'.
You need to read the spec of these format. Stick with rtf, read the spec here: http://www.biblioscape.com/rtf15_spec.htm
You can convert a module to rtf format from the 'Module Properties' dialog (see second tab, Actions)
Costas


Tue Mar 13, 2012 6:34 pm
Profile WWW

Joined: Mon Mar 12, 2012 9:06 pm
Posts: 4
Post Re: How to edit non-Bible modules (.twm)
thanx, that's I need.


Tue Mar 13, 2012 7:45 pm
Profile

Joined: Mon Mar 12, 2012 9:06 pm
Posts: 4
Post Re: How to edit non-Bible modules (.twm)
At long time I can't read data because compression was included.

How work this compression?
In what columns it mark that is compressed?

What formula to compress and uncompress data.


Wed Mar 21, 2012 12:46 pm
Profile

Joined: Mon Mar 12, 2012 9:06 pm
Posts: 4
Post Re: How to edit non-Bible modules (.twm)
It's a simple gzip coded text?
And in DB marked as config.comressed 0 or 1?

Exist something else?


Wed Mar 21, 2012 1:24 pm
Profile
Site Admin

Joined: Tue Aug 29, 2006 2:09 pm
Posts: 8534
Location: Corfu, Greece
Post Re: How to edit non-Bible modules (.twm)
matara wrote:
It's a simple gzip coded text?
And in DB marked as config.comressed 0 or 1?

Exist something else?

Yes, it is simple gzip compression and the last 30 bytes contain a signature (fixed) that denote that the field is compressed. The config.compressed is mostly pointing to whether the whole module is compressed.
If you need the signature in bytes tell me,
Costas


Wed Mar 21, 2012 1:54 pm
Profile WWW

Joined: Wed Oct 10, 2012 7:54 pm
Posts: 2
Post Re: How to edit non-Bible modules (.twm)
hi all!

Costas, thank you for information, but I'd like to know how can I extract the data, pls?


Wed Oct 10, 2012 8:05 pm
Profile
Site Admin

Joined: Tue Aug 29, 2006 2:09 pm
Posts: 8534
Location: Corfu, Greece
Post Re: How to edit non-Bible modules (.twm)
kadmy wrote:
hi all!

Costas, thank you for information, but I'd like to know how can I extract the data, pls?

Be more specific pls of what you are trying to accomplish and how,
Costas


Wed Oct 10, 2012 9:05 pm
Profile WWW

Joined: Wed Oct 10, 2012 7:54 pm
Posts: 2
Post Re: How to edit non-Bible modules (.twm)
I tried understand how programmatically to get 'data' field (how to uncompress it), how after this to use 'rvf' format (which rvt->rtf converters exist, for example for .Net or oOoffice basic).

But now the question is resolved, I done convertation of module to rtf format as you described above. Thank you very much.


Thu Oct 11, 2012 6:50 am
Profile
Site Admin

Joined: Tue Aug 29, 2006 2:09 pm
Posts: 8534
Location: Corfu, Greece
Post Re: How to edit non-Bible modules (.twm)
Welcome. Just to answer quickly, the easiest way to uncompress and convert to rtf is from within theWord itself, else it's kind of difficult to program it
Costas


Thu Oct 11, 2012 8:19 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 24 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.