You are here: PSPad forum > English discussion forum > Re: Extract & Join - Bible verses, chapters etc.

Re: Extract & Join - Bible verses, chapters etc.

#1 Extract & Join - Bible verses, chapters etc.

Posted by: PSPad | Date: 2022-06-17 13:31 | IP: IP Logged

I am looking for a script that will extract just the verses and join.

Main Source:
Isa 49:5-8 that formed.
Isa 51:5; 60:9; 66:19; Zep 2:11 the isles.
Jer 1:5 Before I.

The expected result should look like this:
Isa 49:5-8; Isa 51:5; 60:9; 66:19; Zep 2:11; Jer 1:5

Options: Reply | Quote | Up ^


#2 Re: Extract & Join - Bible verses, chapters etc.

Posted by: vbr | Date: 2022-06-17 18:33 | IP: IP Logged

PSPad:
I am looking for a script that will extract just the verses and join.

Main Source:
Isa 49:5-8 that formed.
Isa 51:5; 60:9; 66:19; Zep 2:11 the isles.
Jer 1:5 Before I.

The expected result should look like this:
Isa 49:5-8; Isa 51:5; 60:9; 66:19; Zep 2:11; Jer 1:5

Hi,
you can use a regular expression replacement and join the lines of this part after that:

Search for last digit, folowed by a space and any non-digit characters until the end of line; replace with that last digit and a semicolon:

(\d) \D*$
Replace with (regex)
$1;

After that, use
Edit: Lines manipulation: Join lines

(There is an extra semicolon at the end too in the result too.)
hth
vbr

Options: Reply | Quote | Up ^


#3 Re: Extract & Join - Bible verses, chapters etc.

Posted by: PSPad | Date: 2022-07-01 10:24 | IP: IP Logged

The expression is not fully compatible with extracting the verse. Any ideas to improve to extract the verses only?
([0-9]* {0,2}[A-Z]{1}\w+[,.;:]? {0,4}[xvilcXVILC\d]+[.,;:]( {0,2}[\d-,]{1,7})+)([,.;:] {0,4}[xvilcXVILC]*[.,;:]( {0,2}[\d-,]{1,7})+)*

biblehub.com

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2022 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR