RP said:
Many thx.. just what I needed to know. Now I've got to learn how to create
a
code module and to execute it for each book.
The reason why I have two separate routines, is that the first routine is
your main
processing loop that would run for each book. that is exactly how/why this
was
setup this way.
The 2nd routine takes that data for ONE record, and spits it out to a
"child" table.
It is assumed that this child table is going to be related back to the main
table. You have to spit out this data to anther table to index each value.
BTW.. the data in the current SUBJECT field appears as :
1. Bible 2. Family 3. Parents 4. Death
Well, that is a bit of different problem now. Give that you understand
software, it should be no surprise that changing our delimiter from a ";" to
a space makes this problem some more complex. What happens if we have:
1. Bible 2. Family 3. Lost Parents 4. Death
We can't use the space as a delimiter to pull out the data. If EVERY SINGE
chapter entry NEVER EVER EVER HAD extra spaces, then we could assume that
EACH chapter is two tokens:
1. Bible 2. Family 3. Parents 4. Death
To parse the above, we could say
take each two words delimited by a space..and those two words become
chapter and text
eg:
1. Bible
2. Family
3. Parents
4. Death
However, if we have:
1. Bible 2. Family 3. Lost Parents 4. Death
Note that our software rule we just made breaks down. Each two words
separated by a space does not represent our results we need anymore. So,
depending on the consistency of this data, the parsing problem is either
easy, or VERY VERY complex!!!
Can we assume that each chapter ALWAYS has a number followed by a "."
(period) ? If we can, then lets use the period as our delimiter!!!!
If you can't use the period, and some chapter text will have MORE then one
word..then, we just inherit a difficult parsing problem (one that would
likely be even worse in FoxPro..since we have a bit better parsing then
those old FoxPro programs).
Other than the numbers, spaces and periods, there are no real delimiters.
Some have only one. Some have more.
Lets assume ALWAYS a number then period.
Question: does ANY of the text have a period in it:
Like
1. Bible 2. Family 3. Inc. Parents 4. Death
And, worse, does any text have:
1. Bible 2. Family 3. Inc. Only 5 ancestors 4. Death
Note the above has a number in the middle of the text.
So, before I waste some more time here, you have to lay out the rules. the
most easy approach is to use the dot (period), but that will only work if
the text NEVER has a period in it..only right after the numbers.
So, given that you written and understand software, the ONLY WAY we can
write this code is to come up with a set of rules that work for you case.
So, can we assume that the data has no "." in it, *EXCEPT* after a number?
Will this rule hold out?