I have written two simple perl scripts to convert unencrypted e-Sword 9 bible and commentary modules to MySword. Besides perl, the script requires the DBI and DBD::SQLite perl modules. Unzip the perl scripts into the directory with the ".bblx" or ".cmtx" files that you wish to convert.
If you run any major Linux distribution, you already have perl on board. To test if you have the modules installed, issue the command "perl -e 'use DBI; use DBD::SQLite;'" (the single quotes are part of the command, the double quotes ae not). If you get an error, indicating that a module is missing from @INC, you need to install the modules. On Debian or a derivative distribution (like Ubuntu), use the command "apt-get install libdbd-sqlite3-perl". On Fedora and RedHat derivatives, the command is "yum install perl-DBD-SQLite" (on RHEL, CentOS or Scientific Linux you may want to include the "rpmforge" repository).
If you run Windows, this script can be used with Strawberry Perl. I advise you to download the portable executable, because that doesn't need installation. Just unpack the distribution somewhere, run the "portableshell.bat" batch file and you have a DOS box where you're good to go (see screen dump).
Change to the directory where you have the perl scripts and bible/commentary files and execute "perl esbblx2mys.pl <bible file>" or "perl escmtx2mys.pl <commentary file>" This will create a MySword file in the same directory. Repeat as needed.
Some things to consider:
- The MySword names are based on the bible abbreviations. If you have a file named "king_james.bblx" that uses the abbreviation "KJV", the MySword file becomes "KJV.bbl.mybible".
- In e-Sword, commentary files can cross chapters, in MySword they cannot. If you have a ".cmtx" file that has a companion ".bblx", have the ".bblx" present in the same directory as the commentary file with the same name except for the ".bblx" extension i.o. ".cmtx". This will be used to find the last verse number of the chapter. If the bible file is not present, the current verse is used, followed by the range in the next chapter.
- If in a bible file, we encounter green superscript numbers, possibly preceded by a "G" or "H", it is considered to be a Strong's dictionary reference and it is encoded as such in the MySword bible file.
- If in a bible file, we encounter red superscript text (like in the NET bible), we consider it a commentary reference and it will be encoded as such. This will reference a commentary module with the same abbreviation as the bible. If the reference text includes a chapter and verse, that is the place where the reference will point to in the commentary module. Else, it will point to the current verse.
Drop me a note if you have a question or if you notice some markup that I missed. In the latter case I might require you to send me your module file so I can see what the markup looks like in the original.
P.S., as my handle implies, I am actually an atheist with an interest in the bible. Please refrain from proselytizing. Let's just agree to disagree on the question of the existence of gods.
Edited to add 2012-08-29: I modified the bible conversion script to better handle UTF characters and RTF tags. If you find a bug, please send me a PM. Thanks to user ebulerdo for thr references to the RTF tags that are being used. If I have some spare time I will also edit the comment conversion script.
Edited to add 2014-08-08: I modified the bible conversion script slightly to better handle nested RTF tags and to do more in memory so it runs faster.
Edited to add 2014-08-11: The commentary conversion script has been modified to fix the same issues as the bible conversion script. Created a single zip file with both scripts.
Edited by Atheist Rob, 11 August 2014 - 07:57 AM.