Electronic Books / Help / English / BiblePhone / Web / Guidance

Guidance, 4


4:1 Create Java books from Word or VPL files with BiblePhone Creator

4:2
Important notice: This method can be easily used for convertig .vpl files (verse-per-line) into thml.

From the bundle archive below dat2xml is in fact perfect finished tool vpl to thml,  with the vpl format specification NumberOfBook(tab)Chapter(tab)Verse(tab)Text.

First of all, download the following
archive.

1.    Convert a .txt file into a .txt database
 
a.    First of all you have to edit your text in Word for Windows using the following rules:
 
i.              Any new chapter will start compulsory with a number.
ii.          Any paragraph will be ended by at least a blank new line.
 
b.    Next you have to save your work in a file. Like an example you have Apostolok tortenete.doc.
 
c.    Then you shall save this file as .txt with UTF-8 option. In our example is Apostolok tortenete.txt.
d.    Then, you shall have to edit an UNL file (i.e. Universal Name Locator)having the following format, the fields being separated by tab character:
 
i.              IDBOOK: the ID associated to the book; it could be a number or similar; for instance look into unl_bible.txt for the UNL associated with a Bible, and in unl.txt for our case with one book (i.e. Apostolok tortenete): 9
ii.          NAME: the name of the book: Apostolok tortenete
iii.       MEMO: a memo as pointer into THML file: AA
iv.          CHAPTERS: the number of the chapters: 61
 
e.    This file can be easily edited with Excel, and then when you save maintain the original format (refuse Excel’s offer to save on Excel format!).
 
f.    Then you shall run txt2database.bat, and you shall enter as follows:
 
i.              Name of the input file: Apostolok tortenete.txt
ii.          Number of the book: 9
iii.       Name of .txt database: Apostolok tortenete_database.txt
 
g.    Now you have in the .txt database format in “Apostolok tortenete_database.txt“ with UTF-8 characters.
  
2.    Convert a .txt database into a THML file
 
a.    You have the .txt database (e.g. : Apostolok tortenete_database.txt).
b.    You shall edit accordingly the unl.txt file (see d. and e. above).
c.    Run database2thml.bat file and answer as follows:
 
i.              Input file name: Apostolok tortenete_database.txt
ii.          Maximum number of the books (i.e. the number of the books from the unl.txt file; 66 is default for the standard Bible): 1
iii.       The number of the verse’s column index, in our case will be 3: 3
iv.          Name of the UNL file: unl.txt
v.              Output file name: Apostolok tortenete.thml
 
 
d.    Apostolok tortenete.thml will be processed with BiblePhoneCreator . On this way, you have to move it in a folder (e.g. d:\thmlfiles) and edit a file named collections.txt. A sample of such a file I supplied here.

This file contains UTF characters, and therefore you can process it with wordpad without problems. If you want to edit the UTF characters, you have to open with WinWord, edit it, save as .txt with UTF-8 option, close it, and then you have to delete the first three characters from the file, added by WinWord as to signal that there is a UTF-8 file. On this way, you can go to start/run and write: cmd and the make an enter. After the prompt is displayed you will navigate to the folder typing the following DOS commands:
   d:
  cd d:\thmlfiles
  edit /80 collections.txt

Then you shall delete the first "monkey" characters that are before the Info tag, save and type "exit" in the DOS window.


e.    Apostolok tortenete.thml will be processed with BiblePhoneCreator . On this way, you have to do as follows:
i.   Download the archive and unzip it in folder (e.g. d:\BiblePhone). This folder will contain a file (BiblePhone.jar) and a folder (BiblePhoneCore).
ii.  Next, edit a batch file (e.g. build.bat) in the folder BiblePhone and edit as follows;
iii. Insert a line like this in the build.bat file: 
        java -Xmx128m -jar BiblePhoneCreator.jar "d:\thmlfiles\Apostolok tortenete.thml" "d:\thmlfiles\collections.txt". A sample you have here.
Then, you will have to run build.bat and you shall see a DOS window running this script. Next, you will have the files according to the collections.txt programming.
  
Note: You have to install before the last step, the Java RunTime Engine (JRE), from www.javasoft.com, and be sure that it is included in the Path system variable. If you open a DOS window (like at step d), when you type "java" you have to obtain messages from the program. If the operating system doesn't recognize this word, you have to put the path to the JRE, by adding to the Path system variable.