Using find/replace to insert file?

A

Andy.III

I have an 1800+ page document consistig of 70,561 paragraphs. Each paragraph is
two sentences.

After each sentence one of twenty tables (each of which has been saved as a
separate file) needs to be inserted.

Can I put somethilg like "tb#20" at the end of each sentence and then use find
and relplace to insert the file "Table-20.doc" after the sentence?

If this can't be done what is the easiest method to accomplish this?
Any help will be greatly appreciated.



Andy.III
 
G

Graham Mayor

This looks like something to get the grey matter working :)

You have a whole raft of two sentence paragraphs. Do you want two insertions
for each paragraph - one for each of the sentences? i.e. 140,000+ tables? I
think that might bring Word kicking and screaming to a halt, but before we
worry too much about that, we need some more information.

What determines which of your 20 documents is to be inserted? If you are
going to have to manually select them, the easiest way would be to use a
formatted autocorrect to replace tb#20 with the field information
{INCLUDETEXT c:\\path\\Table-20.doc"} (one for each document) and as you
type in the code the field will be inserted automatically.

If you have some means of determining the choice from the content of the
text (or other means) then a macro would speed things up a bit :) In theory
there is no reason why you could not use replace to swap your codes for
documents to be inserted, but I would initially be more interested in how
you intend to place the codes.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

Andy.III

This looks like something to get the grey matter working :)
I was hoping it would whet someone's interest! :)
You have a whole raft of two sentence paragraphs. Do you want two insertions
for each paragraph - one for each of the sentences? i.e. 140,000+ tables? I
think that might bring Word kicking and screaming to a halt, but before we
worry too much about that, we need some more information.

Actually, I want one insertion after each sentence but each paragraph's
insertions will be two different tables.
What determines which of your 20 documents is to be inserted? If you are
going to have to manually select them, the easiest way would be to use a
formatted autocorrect to replace tb#20 with the field information
{INCLUDETEXT c:\\path\\Table-20.doc"} (one for each document) and as you
type in the code the field will be inserted automatically.

The first sentence concerns a person's birth and if his parents are related to
each other and if so what that relationshop is (i.e. John Doe, born 15 Sep 1875
- died 27 Jun 1927, was the third child and second son of James Doe and Jane
Whoever- who were themselves third cousins once removed.). The table for this
sentence will be determined by the relationship between the parents.

The second sentence concern's a person's marriage and it there is a blood
relationship between the spouses and if so what that relationship is (i.e. On
21 Oct 1899 he married his ninth cousin once removed, Jill Whosits, who was 19,
eldest daughter of Jack Something and Mary Whatshername). The table for this
sentence will be determined by the relationship between the marrying parties
If you have some means of determining the choice from the content of the
text (or other means) then a macro would speed things up a bit :) In theory
there is no reason why you could not use replace to swap your codes for
documents to be inserted, but I would initially be more interested in how
you intend to place the codes.

See above for determination of tables.

The final output should look like:

John Doe, born 15 Sep 1875 - died 27 Jun 1927, was the third child and second
son of James Doe and Jane Whoever- who were themselves third cousins once
removed.

On 21 Oct 1899 he married his ninth cousin once removed, Jill Whosits, who was
19, eldest daughter of Jack Something and Mary Whatshername- who were
themselves fourth cousins twice removed.


Next paragraph-etc.

The formatted autocorrect includetext option may be the easiest as I know
nothing at all about macros. How many Autocorrect entries can be preformatted?

I'm using word 2000 if it males a difference.

Thanks for taking the time to look at this. I greatly appreciate it.



Andy.III
 
G

Graham Mayor

Ouch :(

So essentially you are starting with a paragraph containing two sentences
and you will be making that into two paragraphs each followed by a different
table?

I understand that the choice of table (from 20?) will be determined by the
content of the paragraphs, but what *exactly* determines which you choose.

How would *you* make the choice? Can Word choose the same criteria to do so
or is it a more subjective choice?

Large numbers of autocorrects (provided they are unique) shouldn't be a
problem, but it would be nice if the process could be automated. If you want
to send me a sample, use the link on my web site.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Andy.III said:
This looks like something to get the grey matter working :)

I was hoping it would whet someone's interest! :)
You have a whole raft of two sentence paragraphs. Do you want two
insertions for each paragraph - one for each of the sentences? i.e.
140,000+ tables? I think that might bring Word kicking and screaming
to a halt, but before we worry too much about that, we need some
more information.

Actually, I want one insertion after each sentence but each
paragraph's insertions will be two different tables.
What determines which of your 20 documents is to be inserted? If you
are going to have to manually select them, the easiest way would be
to use a formatted autocorrect to replace tb#20 with the field
information {INCLUDETEXT c:\\path\\Table-20.doc"} (one for each
document) and as you
type in the code the field will be inserted automatically.

The first sentence concerns a person's birth and if his parents are
related to each other and if so what that relationshop is (i.e. John
Doe, born 15 Sep 1875
- died 27 Jun 1927, was the third child and second son of James Doe
and Jane Whoever- who were themselves third cousins once removed.).
The table for this sentence will be determined by the relationship
between the parents.

The second sentence concern's a person's marriage and it there is a
blood relationship between the spouses and if so what that
relationship is (i.e. On 21 Oct 1899 he married his ninth cousin once
removed, Jill Whosits, who was 19, eldest daughter of Jack Something
and Mary Whatshername). The table for this sentence will be
determined by the relationship between the marrying parties
If you have some means of determining the choice from the content of
the
text (or other means) then a macro would speed things up a bit :) In
theory there is no reason why you could not use replace to swap your
codes for documents to be inserted, but I would initially be more
interested in how
you intend to place the codes.

See above for determination of tables.

The final output should look like:

John Doe, born 15 Sep 1875 - died 27 Jun 1927, was the third child
and second son of James Doe and Jane Whoever- who were themselves
third cousins once removed.

On 21 Oct 1899 he married his ninth cousin once removed, Jill
Whosits, who was 19, eldest daughter of Jack Something and Mary
Whatshername- who were themselves fourth cousins twice removed.


Next paragraph-etc.

The formatted autocorrect includetext option may be the easiest as I
know nothing at all about macros. How many Autocorrect entries can be
preformatted?

I'm using word 2000 if it males a difference.

Thanks for taking the time to look at this. I greatly appreciate it.



Andy.III
 
A

Andy.III

I understand that the choice of table (from 20?) will be determined by the
content of the paragraphs, but what *exactly* determines which you choose.

How would *you* make the choice? Can Word choose the same criteria to do so
or is it a more subjective choice?

Ahh, I see.
Each table will be a blank table consisting of 3 coulmns by "x" rows. The
number of rows will be determined by the relationship in the sentence. The HARD
part is going to be going back and cutting and pasting in the names to fill
those rows and columns! <G>

A first cousin relationship would require 3 rows

1st Col. 2nd. Col 3rd Col
John Doe
Jack Doe Siblings Jane Doe
James Doe First cousins Jill NewSurname

An 11th cousin twice removed would take 15 rows


I'm guessing at this point that 20 tables will do it (that should cover out to
a 12th cousin 6 times removed!) since one table can serve several relationships
( i.e a table for 2nd cousins and a table for first cousins once removed both
require 4 rows).

Generally such relationships are expressed in genealogy with codes such as 1C1R
( first cousin one removed), 2C5R(second cousin five times removed), etc. so in
theory those should be ok to use for unique autocorrects-right?
Large numbers of autocorrects (provided they are unique) shouldn't be a
problem, but it would be nice if the process could be automated. If you want
to send me a sample, use the link on my web site.

I'll work up a sample of what I start with, how the sentences/relationships are
determined and how I want it to end and take you up on your kind offer! (but
tomorrow- its after 4AM here and I've been up 30+ hours as it is <G>)

Again- thanks for the help!
Andy
Andy.III
 
G

Graham Mayor

I think a specialist geneology database may be a lot simpler than the work
that is going to be involved here, but I will have a look at your samples.
I'm already starting to feel sorry I asked ;)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Greg

Andy,

Yes I believe it could be done with find and replace.
When you say "something like tb#20" at the end of each
paragraph," I take that to mean it could be anything from
tb#1 to tb#20. I think you could do this by selecting and
saving each table as an AUTOTEXT entry and then find text
and replace with AUTOTEXT. See:

http://www.gmayor.com/Autotext_replace.htm

However, if the tables are subject to change I would
probably maintain the tables in separate document and
bookmark each individual table or (save in twenty diffent
docs). Then create an AUTOTEXT entries for each bookmark
or individual table document as follows:

{ INCLUDETEXT "C:\\Table Set.doc" tb1 } where c:\\ is
subsituted for your file path and tb1 is the bookmark name
for table 1

or just

{ INCLUDETEXT "C:\\Table 1.doc" }

Then again apply Grahams macro.
 
D

Dayo Mitchell

Side Note to consider:
I know Word can handle documents of up to 10,000 pages , so long as it has
lots of memory/power. But I'm estimating 140,000 sentences for Andy's doc,
and therefore (if reading correctly) 140,000 tables, bringing it to who
knows how many pages....at least 3600, I should think.

Is this a good idea? I know Word can choke on very long tables, is it okay
with massive numbers of short tables?

Also, Andy, does your computer have the power and memory to deal with this
size doc? If the 1800 pages isn't already driving you insane, I'd imagine
it'd be fine, but....

DM
 
A

Andy.III

Side Note to consider:
I know Word can handle documents of up to 10,000 pages , so long as it has
lots of memory/power. But I'm estimating 140,000 sentences for Andy's doc,
and therefore (if reading correctly) 140,000 tables, bringing it to who
knows how many pages....at least 3600, I should think.

Is this a good idea? I know Word can choke on very long tables, is it okay
with massive numbers of short tables?

Also, Andy, does your computer have the power and memory to deal with this
size doc? If the 1800 pages isn't already driving you insane, I'd imagine
it'd be fine, but....

DM

It handles the 1800+ pages fine- even when I did a find/replaces that involved
68,000 entries!- which DID surprise me!

I've also wondered if that many tables would cause Word to choke.... we'll see!
;)

Andy.III
 
A

Andy.III

I'd like to thank all who took part in this discussion.

Having slept on it I believe that the following procedure will do what I want
without the possibility of Word choking on 140,000+ tables.

1) I'll copy each paragraph to a new file and edit that file and using
autocorrect to insert the required table and then filling it in and then
converting the table to text.
2) I'll save this edited file under two different names (one as a backup and
one to be used for adding future edited paragraphs.

At the end I should have
1) My original unedited file
2) An edited file of each paragraph
3) A completely edited file containing ALL paragraphs that is ALL text with no
tables.

The desired end is to have a file that can be converted to a PDF file from
which a Print of Demand Printer can produce a series of books.

This is a project that is NOT time sensitive.

Anyone see any major flaws in it?


Andy.III
 
G

Graham Mayor

Apart from the complexity of handling 140,000 files it should be better, but
I would still like to see the infomation saved as a database with the
results produced by a report or merge - and as I indicated in an earlier
post there are geneology programs around that should make this task easier.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

Andy.III

Apart from the complexity of handling 140,000 files it should be better, but
I would still like to see the infomation saved as a database with the
results produced by a report or merge - and as I indicated in an earlier
post there are geneology programs around that should make this task easier.

LOL!!

Graham, I use The Master Genealogist- probably THE premier genealogy program. I
have some of these people in it but it is to keep from keying in all the info
on 70,000+ people that I decided to do it this way-particularly since I woud
still have to hand edit any report it output to get the layout I want. <G>

Perhaps I should have been more clear- the 140,000 files will be backup only.
After I complete the first paragraph (after converting tables to text) I'll
just copy that to a new file and then also copy it to a second new file the
next paragraph will be done the same except after saving the first copy it will
be copied to the second new file as the second paragraph of that file. That way
I don't have to go back and insert 140,000 in order :)

Eventually I hope to get a small group of volunteers together and have the
whole thing keyed into my genealogy program. There are several websites that
have most of the same info but they aren't really set up to allow a person
access to duplicating the database on one 's own machine- not that I blame them
a bit! :)


Andy.III
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top