[sword-devel] shell help

Troy A. Griffitts scribe at crosswire.org
Wed Nov 18 23:40:20 MST 2009


Hey guys,

I'm trying to setup a reproducible process to convert the Tregelles data
to a SWORD imp data time.  I have a series of sed commands to replace
tags, etc.... (yeah, yeah. I'm sure perl could do it in one line...)

But anyway, I've got one problem left that I could use some help with:

Here is a worst case real sample pattern:


...υντελείας τοῦ αἰῶνος.

<Page = 119><Title = ΕΥΑΓΓΕΛΙΟΝ ΚΑΤΑ ΜΑΡΚΟΝ.>
$$$Mark.1.1
<SB>Ἀρχὴ τοῦ εὐαγγελίου Ἰησοῦ χριστοῦ υἱοῦ θεοῦ·


It needs to become:

...υντελείας τοῦ αἰῶνος.
<SB>

$$$Mark.1.1
<Page = 119><Title = ΕΥΑΓΓΕΛΙΟΝ ΚΑΤΑ ΜΑΡΚΟΝ.>
Ἀρχὴ τοῦ εὐαγγελίου Ἰησοῦ χριστοῦ υἱοῦ θεοῦ·

So, the rules in pros:

<SB> which start a new line must be moved to the end of the
non-zero-length line preceding the previous $$$

^<Page = [^>]*><Title = [^>]*>$ lines must be moved down just below the
next $$$ line.


Any help would be appreciated.  Preferably with something like awk (I
don't think sed can work multiline can it?)  I guess perl would be ok too :)


Thanks for any help,

	-Troy.




More information about the sword-devel mailing list