Editing CTX files
sbobovyc edited this page Aug 24, 2012
·
14 revisions
Unpacking
- Run the following command:
ctx_magick.exe somefile.ctx - This should generate a YAML file called somefile.ctx.txt and somefile.sqlite. The sqlite file is a new addition and is easier to edit then the YAML file. The YAML file is now a legacy feature.
Editing sqlite database
- Open somefile.sql with an sqlite browser. I recommend http://sourceforge.net/projects/sqlitebrowser/
- The file will contain a "Meta" table. This table is for information purpose only. The packer will not use it to compile a CTX file.
- The "eng", "fra", and other tables contain the text IDs and text.
- When you add items, you have to add the items to all languages.
- Save the database after you've made changes.
Editing YAML file
- Open somefile.ctx.txt with a text editor.
- Make sure that your text editor does not replace spaces with tabs.
- When you add items, you have to add the items to all languages.
- All languages must end with the same item.
- Text containing punctuation marks must be surrounded with single quotes. For example:
- [906, '4,73 x 33 mm sans douille']
- Save the text file after you've made changes.
Packing
- Run the following command:
ctx_magick.exe somefile.ctx.txt
Or
ctx_magic.exe somefile.sqlite - This should generate a CTX file which you should copy into the appropriate location in bin_win32.
CTX format
Text in CTX files is stored in utf-16le.
Notes on sqlite
You can run queries on the data.