in reply to Gentleman, I'm lost.

Here is simplified code:
while(<DATA>){ chomp; # remove newlines next unless $_; # no empty lines? # check if a newline is required s/(\d+:\d+)/\n${1}/; # make lines end in space (separate words) s/\s?$/ /; print; } print "\n"; # end __DATA__ 3:3 And he shall offer of the sacrifice of the peace offering an offering made by fire unto the LORD; the fat that covereth the inwards, and all the fat that is upon the inwards, 3:4 And the two kidneys, and the fat that is on them, which is by the flanks, and the caul above the liver, with the kidneys, it shall he take away. 3:5 And Aaron's sons shall burn it on the altar upon the burnt sacrifice, which is upon the wood that is on the fire: it is an offering made by fire, of a sweet savour unto the LORD.

Yields:

3:3 And he shall offer of the sacrifice of the peace offering an offer +ing made by fire unto the LORD; the fat that covereth the inwards, an +d all the fat that is upon the inwards, 3:4 And the two kidneys, and the fat that is on them, which is by the +flanks, and the caul above the liver, with the kidneys, it shall he t +ake away. 3:5 And Aaron's sons shall burn it on the altar upon the burnt sacrifi +ce, which is upon the wood that is on the fire: it is an offering mad +e by fire, of a sweet savour unto the LORD.

I still need an example of a separate chapter, or are you doing each book separately?

Here is the oneliner:

cat chapter.txt | perl -pe 'chomp; next unless $_; s/(\d+:\d+)/\n${1}/ +;s/\s?$/ /;'

Note: if you are using Windows, replace the single quotes to double quotes, i.e. perl.exe -pe "..."

Replies are listed 'Best First'.
Re^2: Gentleman, I'm lost.
by FreeBeerReekingMonk (Deacon) on Nov 26, 2016 at 10:43 UTC
    From that, try to expand:

    my @VERSES,$longline; while(<DATA>){ chomp; # remove newlines next unless $_; # no empty lines? # check if a newline is required s/(\d+:\d+)/\n${1}/; # make lines end in space (separate words) s/\s?$/ /; $longline .= $_; } @VERSES = split(/\n/, $longline); for my $verse (@VERSES){ # remove verse number from verse $verse=~s/(\d+:\d+)\s*//; my $versenumber = $1; print "# verse $versenumber #\n"; my @phrases = split(/\s*[,.;:]\s*/, $verse); for my $phrase (@phrases){ $_ = uc($phrase); # uppercase tr/0123456789/0000000000/; tr/ABCDEFGHIJKLMNOPQRSTUVWXYZ/12345678912345678912345678/; my $value = 0; $value += $_ for(split(//)); # sum print "TXT:$phrase\nNRX:$_ = $value\n"; } } __DATA__ 3:3 And he shall offer of the sacrifice of the peace offering an offering made by fire unto the LORD; the fat that covereth the inwards, and all the fat that is upon the inwards, 3:4 And the two kidneys, and the fat that is on them, which is by the flanks, and the caul above the liver, with the kidneys, it shall he take away. 3:5 And Aaron's sons shall burn it on the altar upon the burnt sacrifice, which is upon the wood that is on the fire: it is an offering made by fire, of a sweet savour unto the LORD.

    Yields:

    # verse # # verse 3:3 # TXT:And he shall offer of the sacrifice of the peace offering an offer +ing made by fire unto the LORD NRX:154 85 18133 66659 66 285 113996935 66 285 75135 66659957 15 66659 +957 4145 27 6995 3526 285 3694 = 409 TXT:the fat that covereth the inwards NRX:285 612 2812 36459528 285 9551941 = 128 TXT:and all the fat that is upon the inwards NRX:154 133 285 612 2812 91 3765 285 9551941 = 134 # verse 3:4 # TXT:And the two kidneys NRX:154 285 256 2945571 = 71 TXT:and the fat that is on them NRX:154 285 612 2812 91 65 2854 = 87 TXT:which is by the flanks NRX:58938 91 27 285 631521 = 85 TXT:and the caul above the liver NRX:154 285 3133 12645 285 39459 = 98 TXT:with the kidneys NRX:5928 285 2945571 = 72 TXT:it shall he take away NRX:92 18133 85 2125 1517 = 64 # verse 3:5 # TXT:And Aaron's sons shall burn it on the altar upon the burnt sacrifi +ce NRX:154 11965'1 1651 18133 2395 92 65 285 13219 3765 285 23952 1139969 +35 = 237 TXT:which is upon the wood that is on the fire NRX:58938 91 3765 285 5664 2812 91 65 285 6995 = 178 TXT:it is an offering made by fire NRX:92 91 15 66659957 4145 27 6995 = 132 TXT:of a sweet savour unto the LORD NRX:66 1 15552 114639 3526 285 3694 = 108

    I am still wondering what you will use it for, the math looks complex