[pm-h] Houston Digest, Vol 41, Issue 11

Haufler, Wayne A Wayne.A.Haufler at boeing.com
Mon Apr 21 08:55:58 PDT 2008


As a Christian, I certainly commend such use of Perl to support Biblical
study, or whatever.

I think I can think of better ways to approach this problem,
but first idea that comes to me is to recommend the use of
OPML (Outline Processor Markup Language). 

>From CPAN, XML::OPML and the like.
This may be too advanced, but if you want true outline 
behavior and functionality, I think this is a good way to go.
I haven't tried it myself, yet, but encountered it during
some research for a pet project which has gone nowhere.

You may be interested to know of another languishing pet project.
A Christian computer game teaching Christian principles with
a mechanical analogue.  I want to use Blender3D programming
in Perl instead of Python, but that may be a pipe dream.

Regards,
-- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
Wayne A. Haufler
Senior Software Engineer (SE)
In Space Shuttle Program (SSP)
Backup Flight System (BFS) 
Displays & Controls Requirements Analyst
Boeing, NASA Systems, Houston
Voice: 	281-226-8626 , Cubicle: 5475
E-mail: wayne.a.haufler at boeing.com
Skills :  Perl,Unix,C,C++,SQL,QNX,GUI 

(Disclaimer: The comments and opinions expressed are my own and do not
represent the view of  Boeing, United Space Alliance, JSC, or NASA.)



-----Original Message-----
From: houston-request at pm.org [mailto:houston-request at pm.org] 
Sent: Saturday, April 19, 2008 2:00 PM
To: houston at pm.org
Subject: Houston Digest, Vol 41, Issue 11

Send Houston mailing list submissions to
	houston at pm.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://mail.pm.org/mailman/listinfo/houston
or, via email, send a message with subject or body 'help' to
	houston-request at pm.org

You can reach the person managing the list at
	houston-owner at pm.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of Houston digest..."


Today's Topics:

   1. generating and populating files using a systematic name
      scheme (Russell L. Harris)


----------------------------------------------------------------------

Message: 1
Date: Fri, 18 Apr 2008 21:18:25 -0500
From: "Russell L. Harris" <rlharris at oplink.net>
Subject: [pm-h] generating and populating files using a systematic
	name	scheme
To: houston at pm.org
Message-ID: <20080419021825.GA3550 at oplink.net>
Content-Type: text/plain; charset=us-ascii

Over the weekend, I am attempting to use Perl for the task outlined
below.  

I have a copy of "Learning Perl" and "Perl Cookbook".  I likely shall be
doing things the hard way, so I welcome recommendations from anyone who
is interested.  

RLH

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%

TASK:

Using an outline template and a set of text files, create a set of
outline files, one per chapter, for each book in the Bible.

The files are to be named according to the following scheme:

    outline-xx-yyy

in which xx is the sequential book number (01, 02, 03, ...) and yyy is
the sequential chapter number (001, 002, 003, ...).

Each outline file starts out as a copy of the outline template, into
which is copied the text of the corresponding chapter, the book name,
the sequential book number, the sequential chapter number, and the
filename.

DATA:

The Bible text is contained in a set of files named '01', '02', etc., in
which each filename is the sequential book number ('01' for Genesis,
'02' for Exodus, etc.).  In each of these files, each newline-delimited
record corresponds to a single verse, and chapters are delimited by the
chapter number followed by a colon (:), as
follows:

    1:1 text of the first verse
    2 text of the second verse
    3 text of the third verse
    ...
    31 text of the last verse
    2:1 text of the first verse
    2 text of the second verse
    3 text of the third verse
    ...
    25 text of the last verse
    3:1 text of the first verse
    ...

ASSOCIATIONS FILE:

A file is used to associate the sequential book number, the book name,
and the number of chapters in the book.  In this file, each
newline-delimited record corresponds to a single book:

   01 Genesis 50
   02 Exodus 40
   ...

OUTLINE TEMPLATE:

In the outline template, several strings (each of which begins with an
equals sign (=)) act as placeholders for: the bookname, the sequential
book number, the sequential chapter number, the outline filename (which
is used in a URL), and the Bible text of the chapter:

    =bookname
    =book
    =chapter
    =filename
    =bibletext

PLAN OF ATTACK:

(1) Step record-by-record through the association file.  Using the
sequential book number and the number of chapters from each record,
append the filename 'outline-xx-yyy' to a copy of the outline template.

(2) Step file-by-file through the outline files (approximately a
thousand in number) which were generated in step one:

    (2.1) Copy the outline filename into the '=filename' field of the
    outline file.

    (2.2) Decompose the outline filename in order to obtain the value
    to enter into the '=book' and '=chapter" fields of the file.

    (2.3) Use the 'book' value from the outline filename to index into
    the associations file, in order to obtain the string to enter into
    the '=bookname' field of the outline file.

    (2.4) Use the 'book' value from the outline filename to index into
    the Bible text directory to select the proper book file; then use
    the 'chapter' value from the outline filename to index into the
    book file to select the proper chapter; and finally copy the text
    of the chapter from the book file into the '=bibletext' field of
    the outline file.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%


------------------------------

_______________________________________________
Houston mailing list
Houston at pm.org
http://mail.pm.org/mailman/listinfo/houston
Website: http://houston.pm.org/

End of Houston Digest, Vol 41, Issue 11
***************************************


More information about the Houston mailing list