HOW TO COMBINE PLAINTEXT BIBLES

0) using firefox and Linux in a BASH konsole terminal ------------------------ 1) find free translations in the public domain and download: e.g. https://www.biblesupersearch.com/bible-downloads/ recommend using: Machine-readable Plain Text the goal is ONE verse per line, not notes, commentary or empty lines: There will be either 31,103 verses in a version like the NASB or 31,102 verses in the KJV - the difference is 1 John 3:15 3Jn 1:14 but I hope to see you shortly, and we will speak face to face. 3Jn 1:15 Peace be to you. The friends greet you. Greet the friends by name. You have TWO options to make a merge of versions work: 1) join the 2 lines in any translation that has 3Jn 1:15 2) add a line with 3Jn 1:15 The difference is between the Textus Receptus and Nestle Aland and other excellent manuscripts. If you're dealing with free versions that are public domain it'll likely be better to combine v15 with 14. From the site listed above you may select several copies, they'll be combined into a zip file. The file will be something like this: truth_20220116_182700_269015.zip find it in your default Download location. ------------------------ 2) mv the file to a unique directory and unzip the file: cd ~/Downloads mkdir ~/Bibles-PlainText mv truth_20220114_170118_228804.zip ~/Bibles-PlainText cd ~/Bibles-PlainText unzip truth_20220114_170118_228804.zip --> unzip truth_20220114_170118_228804.zip Archive: truth_20220114_170118_228804.zip inflating: chinese_union_simp.txt inflating: kjv.txt inflating: segond_1910.txt inflating: tr.txt inflating: korean.txt inflating: opt.txt inflating: cadman.txt inflating: readme.txt ------------------------ 3) organize, archive and rename files: mkdir ORIG-files # keeping the originals untouched is a good idea. cp *.txt ORIG-files mv truth_20220114_170118_228804.zip ORIG-files more readme.txt # read what it has to say RENAME the files to something easier to deal with, use country codes: mv chinese_union_simple.txt CN.txt # mandarin - chinese mv kjv.txt KJV.txt # KJV mv segone_1910.txt FR.txt # french text mv tr.txt TR.txt # turkish text mv korean.txt KR.txt mv opt.txt IR.txt # old persian text - Iran mv cadman.txt VN.txt # Vietnamese version rm -f readme.txt # you have a copy in the original --> mv cadman.txt VN.txt ; mv chinese_union_simp.txt CN.txt ; \ mv korean.txt KR.txt ; mv opt.txt IR.txt ; mv segond_1910.txt FR.txt ; \ mv tr.txt TR.txt ; rm -f readme.txt ------------------------ 4) list your directory; you have 7 translations: --> ls CN.txt FR.txt IR.txt KJV.txt KR.txt ORIG-files TR.txt VN.txt ------------------------ 5) Recommend creating a file that has lines to separate verses. echo "------------------" > lines.txt vi lines.txt # follow the exact steps below if you don't know how to us vi: YY 31102 p <esc>:wq verify 31,103 lines: # we are adding 1 line so we can identify the Bible --> cat lines.txt | wc -l 31103 ------------------------ 6) now edit each file to only have the name of the Bible at the top line, then save the file and check its line count to see that it has 31,103 lines. IF it has 31,104 lines then edit the file and find 3 John 1:14 and see if there is a verse 15, if so combine those lines, recheck total lines. example: -->vi CN.txt Chinese Union (Simplified) This Bible is in the Public Domain. <feff>創 世 記 1:1 起 初 ,   神 创 造 天 地 。 ## You will need to combine the lines before the beginning of the text to one line: # once in the vi editor, move the cursor to the top of the file, <esc> 1G # then hit Shift J until the two text lines and the 2 blank lines are all on one: Chinese Union (Simplified) This Bible is in the Public Domain. <feff>創 世 記 1:1 起 初 ,   神 创 造 天 地 。 # recommend NOT editing the text as the characters might not behave well. # SAVE the file and check line count, should be 31,103 (because of the top line and combined 3 John 1:14 & 15 (if needed) (this will be challenging in some of the languages...) <esc>:wq then: --> cat CN.txt | wc -l 31103 # SUCCESS... move on to the next translation and repeat the process... having the name of the translation and any copyright notices at the top of the file and combining 3 John 1:14 & 15 if necessary. ------------------------ 7) an easy way to check all of the files for line length after editing is to write a script or just repeat the cat FILENAME | wc -l for each one. To create a script type the following: --> ls | tee test-length.sh ; vi test-length.sh CN.txt FR.txt IR.txt KJV.txt KR.txt ORIG-files lines.txt TR.txt VN.txt # in the vi editor remove the ORIG-files; in vi, hit <esc>, then the letter "j" (5 times) until the cursor is on "ORIG-files", then hit the letters "dd". Move the cursor with "j" or "k" to the line with test-length.sh, hit dd (If you have blank lines below, move the cursor to the blank lines and hit dd to delete those so you only have lines with text in your file.) CN.txt FR.txt IR.txt KJV.txt KR.txt ORIG-files lines.txt test-length.sh TR.txt VN.txt ### save your work but don't quit: type: <esc>:w ### at this point you are going to use a global edit to create a script: # hit <esc>, then the following: :set nu # now you will see numbers along the side of each line, e.g. 1 CN.txt 2 FR.txt 3 IR.txt 4 KJV.txt 5 KR.txt 6 lines.txt 7 TR.txt 8 VN.txt # now you are going to replace each line with the commands needed: <esc>:1,8s/.*/cat & | wc -l/g cat CN.txt | wc -l cat FR.txt | wc -l cat IR.txt | wc -l cat KJV.txt | wc -l cat KR.txt | wc -l cat lines.txt | wc -l cat TR.txt | wc -l cat VN.txt | wc -l # (there will be the numbers to the left, to turn off the numbers type <esc>:set nonu and it should appear as above. ) # SAVE and QUIT, <esc>:wq --------------------------------- 8) execute your script as follows: --> sh ./test-length.sh 31103 31103 31103 31103 31103 31103 7959 31103 # OOPS... TR.txt is NOT the Turkish translation, but the Textus Receptus, my bad... so we will remove that file from this by moving the file to our ORIG-files directory and rename it: --> mv TR.txt ORIG-files/TextusReceptus.txt --------------------------------- 9) NOW we are ready to concatenate our plain text Bibles into one: after an "ls" and ignoring ORIG-files, we see: CN.txt FR.txt IR.txt KJV.txt KR.txt lines.txt VN.txt It's a good idea to start the first line with the English version, and then the other languages in their order globally, you'd set the order as following: (in this example English is #1 in "known" languages, but 3rd in spoken; Chinese is #1 in spoken and #2 in known; French is 5th in known, while Persian, Korean and Vietnamese would be less. YMMV as to the order.) KJV.txt CN.txt FR.txt IR.txt KR.txt VN.txt lines.txt --------------------------------- 10) Now we will use the PASTE command to create a file line by line (the '\n' is for new line). The paste command reads each file, line by line and inserts a new line at the end of each pass. It is important that each file is the same length, otherwise blank lines for that file will be inserted. # by typing this it will display on the screen only: paste -d '\n' KJV.txt CN.txt FR.txt IR.txt KR.txt VN.txt lines.txt # by typing this it will be redirected from "stdout" (the screen) to the named file: paste -d '\n' KJV.txt CN.txt FR.txt IR.txt KR.txt VN.txt lines.txt > KJV-CN-F-IR-K-V.txt # now you can examine the file using head and tail or more to make sure it lined up. --> head KJV-CN-F-IR-K-V.txt Public Domain - King James Version Chinese Union (Simplified) This Bible is in the Public Domain. Louis Segond 1910 This Bible is in the Public Domain. Old Persian Translation This Bible is in the Public Domain. Korean This Bible is in the Public Domain. Vietnamese Cadman This Bible is in the Public Domain. ------------------ Gen 1:1 In the beginning God created the heaven and the earth. (kjv) 創 世 記 1:1 起 初 ,   神 创 造 天 地 。 Genèse 1:1 ¶ Au commencement, Dieu créa les cieux et la terre. ### of course if you want to check further into the file you can add more to the head command as follows: --> head -n 14 KJV-CN-F-IR-K-V.txt Public Domain - King James Version Chinese Union (Simplified) This Bible is in the Public Domain. Louis Segond 1910 This Bible is in the Public Domain. Old Persian Translation This Bible is in the Public Domain. Korean This Bible is in the Public Domain. Vietnamese Cadman This Bible is in the Public Domain. ------------------ Gen 1:1 In the beginning God created the heaven and the earth. (kjv) 創 世 記 1:1 起 初 ,   神 创 造 天 地 。 Genèse 1:1 ¶ Au commencement, Dieu créa les cieux et la terre. Genesis 1:1 در ابتدا، خدا آسمانها و زمین را آفرید. Genesis 1:1 태초에 하나님이 천지를 창조하시니라 ! Genesis 1:1 Ban đầu Ðức Chúa Trời dựng nên trời đất. ------------------ ### same thing with the tail command: --> tail -n 14 KJV-CN-F-IR-K-V.txt Rev 22:20 He which testifieth these things saith, Surely I come quickly. Amen. Even so, come, Lord Jesus. (kjv) 启 示 录 22:20 证 明 这 事 的 说 : 是 了 , 我 必 快 来 ! 阿 们 ! 主 耶 稣 阿 , 我 愿 你 来 ! Apocalypse 22:20 ¶ Celui qui atteste ces choses dit: Oui, je viens bientôt. Amen! Viens, Seigneur Jésus! Revelation 22:20 او که بر این امور شاهد است، میگوید، بلی، به زودی میآیم! آمین. بیا، ای خداوند عیسی! Revelation 22:20 이것들을 증거하신 이가 가라사대 내가 진실로 속히 오리라 ! 하시거늘 아멘 주 예수여 ! 오시옵소서 Revelation 22:20 Ðấng làm chứng cho những điều ấy, phán rằng: Phải, ta đến mau chóng. A-men, lạy Ðức Chúa Jêsus, xin hãy đến! ------------------ Rev 22:21 The grace of our Lord Jesus Christ be with you all. Amen.(kjv) 启 示 录 22:21 愿 主 耶 稣 的 恩 惠 常 与 众 圣 徒 同 在 。 阿 们 ! Apocalypse 22:21 Que la grâce du Seigneur Jésus soit avec tous! Revelation 22:21 فیض خداوند ما عیسی مسیح با همهٔٔ شما باد. آمین. Revelation 22:21 주 예수의 은혜가 모든 자들에게 있을지어다 ! 아멘 Revelation 22:21 Nguyền xin ân điển của Ðức Chúa Jêsus ở với mọi người! --------- 11) At this point you could copy this file to a friend or just use it for viewing or searching. Using grep you can search on any of the lines, but for the most part we will be searching for English so we'll set the grep to view the context AFTER the line to include the other languages: --> grep -A 6 "3Jn 1:14" KJV-CN-F-IR-K-V.txt 3Jn 1:14 But I trust I shall shortly see thee, and we shall speak face to face. Peace be to thee. Our friends salute thee. Greet the friends by name.(kjv) 約 翰 三 書 1:14 但 盼 望 快 快 的 见 你 , 我 们 就 当 面 谈 论 。 [ (III John 1:15) 愿 你 平 安 。 众 位 朋 友 都 问 你 安 。 请 你 替 我 按 着 姓 名 问 众 位 朋 友 安 。 ] 3 Jean 1:14 J'espère te voir bientôt, et nous parlerons de bouche à bouche. Que la paix soit avec toi! Les amis te saluent. Salue les amis, chacun en particulier. 3 John 1:14 لکن امیدوارم که به زودی تو را خواهم دید و زبانی گفتگو کنیم. سلام بر تو باد. دوستان به تو سلام میرسانند. سلام مرا به دوستان نام به نام برسان. 3 John 1:14 속히 보기를 바라노니 또한 우리가 면대하여 말하리라 3 John 1:14 tôi ước ao tới thăm anh cho sớm và chúng ta sẽ đối mặt nói chuyện với anh! Các bạn hữu chào thăm anh. Hãy chào thăm các bạn hữu theo đích danh từng người. ------------------ # you can add a line BEFORE to get the line for clarity: --> grep -B 1 -A 6 "3Jn 1:14" KJV-CN-F-IR-K-V.txt ------------------ 3Jn 1:14 But I trust I shall shortly see thee, and we shall speak face to face. Peace be to thee. Our friends salute thee. Greet the friends by name.(kjv) 約 翰 三 書 1:14 但 盼 望 快 快 的 见 你 , 我 们 就 当 面 谈 论 。 [ (III John 1:15) 愿 你 平 安 。 众 位 朋 友 都 问 你 安 。 请 你 替 我 按 着 姓 名 问 众 位 朋 友 安 。 ] 3 Jean 1:14 J'espère te voir bientôt, et nous parlerons de bouche à bouche. Que la paix soit avec toi! Les amis te saluent. Salue les amis, chacun en particulier. 3 John 1:14 لکن امیدوارم که به زودی تو را خواهم دید و زبانی گفتگو کنیم. سلام بر تو باد. دوستان به تو سلام میرسانند. سلام مرا به دوستان نام به نام برسان. 3 John 1:14 속히 보기를 바라노니 또한 우리가 면대하여 말하리라 3 John 1:14 tôi ước ao tới thăm anh cho sớm và chúng ta sẽ đối mặt nói chuyện với anh! Các bạn hữu chào thăm anh. Hãy chào thăm các bạn hữu theo đích danh từng người. ------------------ You can create functions in your .bashrc to make the grep command less complex: http://johnmeister.com/linux/Scripts/FUNCTIONS-n-ALIASES.html --------------------------------- 12) At this point you can covert each of these files to html with a couple of lines at the top and the bottom. at the TOP these 4 lines: <html> <head><title> KJV and other translations </title> <META CHARSET="UTF-8"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1"> <body bgcolor="#FFF8DC" LINK="green" VLINK="red" ALINK="orange" text="black"> <center><table border="10" width="90%" bgcolor="white"><tr><td> <pre> at the BOTTOM this one line: </pre> </td> </tr> </table></center> </body> </html> ### There are several ways of adding those 4 lines to the top of the file. - using the vi editor, and pasting in from the mouse in a terminal - using sed to add lines to the top - creating a file with those 4 lines, opening it, reading in the main file and saving it as the main file name, repeat that process for each of the files. ### to add the bottom line simply type: echo "</pre> </td> </tr> </table></center> </body> </html>" >> FILENAME.html ## be certain to have TWO greater than signs or you will over write the file. ### one other note... if you place any greater or less than symbols in an html file, you will need to place them as: > and < or they will mess up the rendering in the browser. ## you can globally replace them by type: <esc>:%s/>/\>/g and <esc>:%s/</\>/g IT IS RECOMMENDED THAT YOU DO THIS BEFORE you combine the files with the header and footer details or you will render you html tags inert. ---------------------------------------