replacing index entries

Everything related to our flagship word processor.
Post Reply
skcryan
Posts: 26
Joined: 2011-04-21 05:31:15

replacing index entries

Post by skcryan »

Hi

I'm hoping there's someone out there who can help save me a lot of time and stress.

I originally planned to do the indexing of a book in NWP, using a two-column table. However, the publisher will only supply a pdf file of the final copy so I have created an index by searching through the 200,000-word document. The problem with this approach is that I now have only the search terms in the index, not the index entries I want. (This means that I have searched citations in the text for family names but I would like them to appear in the index as family name plus initials.)

The current entries appear like the left-hand column but I would like them to appear as in the column on the right.
Aida **********/********** Aida, Y.
Al-Baharna ****/********** Al-Baharna, S.

My question is if there any way to do some kind of 'bulk replace', maybe using the original table I had created for the NWP indexing. I'm not sure if I can face going through the whole index again manually adding initials to each entry.

Thanks
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Re: replacing index entries

Post by Hamid »

If you have a list of all the search terms, you can create a concordance file from it and then use the concordance file to mark all the index entries with a single command.
Please view this thread:
http://nisus.com/forum/viewtopic.php?f=17&t=3113
skcryan
Posts: 26
Joined: 2011-04-21 05:31:15

Re: replacing index entries

Post by skcryan »

Thanks Hamid. I really do appreciate your taking the time. I feel like I'm so close yet so far right now. I have a file with surnames only + page numbers. (The output from my original search of the pdf file.

Aida, 19
Al-Baharna, 106

I also have the tab-separated file with the search terms (the above family names) in the first column and the replace terms (family name + intiials) in the second column.

Aida ***/**Aida, Y.
Al-Baharna **/** Al-Baharna, S.

I read through the other thread - thank you - but still can't quite work out how to run the macro to produce the desired outcome:
Aida, Y., 19
Al-Baharna, S., 106

So far, I've managed to produce all kinds of combinations, but never the one I'm aiming for. I feel like I'm missing something really simple.
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Re: replacing index entries

Post by Hamid »

If you already have a concordance file with tab-separated entries which look like this:

Aida Aida, Y.
Al-Baharna Al-Baharna, S.

etc.

and assuming that there is only one Aida with the initial Y, and not another Aida with another initial, make a copy of your file and proceed as follows:

1. Select the entire body of the text (Command-A) that you want to mark for indexing and apply the Tools:Index:Index using Word list... menu command.
This will bring up the Open dialog to select the concordance file which contains the tab separated list.

2. Select the name of the concordance file in the Open dialog and press the Auto Index button. This will mark all the index entries.
If there are footnotes or endnotes, and you want them to be indexed as well, select the entire footnote/endnote area and repeat steps 1 and 2.

3. Then run the Tools:Index:Insert Index... menu command to create the index.

If there is already a previous index in the file, place the cursor anywhere in the index and run the Rebuild Index command from the Tools:Index menu.

Let me know the result.
Last edited by Hamid on 2012-04-22 01:44:38, edited 1 time in total.
skcryan
Posts: 26
Joined: 2011-04-21 05:31:15

Re: replacing index entries

Post by skcryan »

Hamid,

Thanks as always for your time and effort. Unfortunately, I'm still not getting it.

I only have the whole book in pdf format so I have been through that file and made an index which has only family names. I've saved that index in a separate file to send to the publisher. If I try to go through the steps you showed me with the 'index from word list', won't this just give me the page numbers from that file? (The file that only contains index entries.)

By the way, when I tried this time, I got the following message:
A word list file should contain a single two-column table. The first column contains the words in your document to find, while the corresponding entry in the second column gives the topic(s) to index under.
Would it be better for me to use the original two-column table I created? Or am I missing something very basic again?

Thanks.
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Re: replacing index entries

Post by Hamid »

In step 1 you have to select the body of the text of the NWP file that you want to mark for indexing. The result of steps 1–3 will give an index with page references to the NWP file.

Was the pdf of the book created in NWP or from a NWP file imported to a page layout app like InDesign?
skcryan
Posts: 26
Joined: 2011-04-21 05:31:15

Re: replacing index entries

Post by skcryan »

Was the pdf of the book created in NWP or from a NWP file imported to a page layout app like InDesign?
I created the original document in NWP, sent it to the publisher, who in turn sent it to somewhere in India. I now have a pdf file of the book, which seems to have been created by InDesign. The publisher will only supply the pdf; I guess they're afraid of authors messing things up.
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Re: replacing index entries

Post by Hamid »

If you already marked index entries in the NWP file before sending it to the publishers, then when the NWP file is imported to InDesign, your index marking will also be imported (depending on InDesign’s import options checked when the file was imported). When the typesetters have finished the layout and the pagination of the book is fixed, they have to use the ‘Generate Index’ command in InDesign to create the index which will match the pagination of the InDesign file as well as the pdf file created from InDesign.
skcryan wrote:Would it be better for me to use the original two-column table I created? Or am I missing something very basic again?
Either a two-column table or a tab separated file can be used. I always use the latter.
If an error was reported, it may be because there was more than one tab on the same line.
skcryan
Posts: 26
Joined: 2011-04-21 05:31:15

Re: replacing index entries

Post by skcryan »

Hi again.
I did mark the original text with index entries but none of that seems to have survived. The file has been through all kinds of hoops since then, external reviewers, copy-editors etc. I think they have all been using Word files and so the work I did last year in preparing the manuscript using NWP has been pretty much a waste of time.
When the typesetters have finished the layout and the pagination of the book is fixed, they have to use the ‘Generate Index’ command in InDesign
The way it works in this case is that they prepare the manuscript and send it back to the editors - me - to prepare the index. They don't do any indexing.
If an error was reported, it may be because there was more than one tab on the same line.
Thanks that's very helpful. That's highly possible. I'll give it one more try and then after that I'll have to give up and do it manually. I'm sure there must be a way, but I can't quite get it. Basically, the indexing issue is irrelevant at this stage, as the index has already been created. It's just a bulk 'Find and Replace' I need to do. I used your Find and Replace macro and that was so close. It found all the entries, gave me the new ones with the author initials, but didn't remove the original entries.

thanks for all your patience. And expertise.
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Re: replacing index entries

Post by Hamid »

skcryan wrote:I did mark the original text with index entries but none of that seems to have survived. The file has been through all kinds of hoops since then, external reviewers, copy-editors etc. I think they have all been using Word files and so the work I did last year in preparing the manuscript using NWP has been pretty much a waste of time.
When you send your NWP file to those working with Word, use the File:Export As.. command and select 'Microsoft Word Format (binary)' filter. This will preserve your NWP index marking in Word.

I was faced with a similar situation about seven years ago.
I had done index marking for a book in a Nisus Writer Classic file. The file had to be imported to InDesign. The best conversion of the Classic file to allow it to go to InDesign was through Nisus Writer Express, but it did not yet have indexing so my index marking was lost in NWE and could not go to InDesign. When the pdf was created from InDesign with the final pagination of the book, I did not want to redo indexing; so I made a copy of my NWC file and simply modified its margins so that the number of pages in it corresponded to the number of pages of the pdf. Then I made sure (by adding superfluous spacing or deleting any unmarked text) that each first line on the pages in the Classic file matched the first lines in the pdf. Then I created the index in NWC which gave the correct page references to the pages of the final pdf.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: replacing index entries

Post by martin »

I might be a little confused as to the situation, but it sounds to me like at this point he needs to just fix the already created index, which isn't a smart (automatically generated) index at all- it's just a regular file that doesn't have any kind of special links/relationship to the final PDF/document. So while talking about how to use NWP's indexing tool is useful for future projects, it won't help here.

So what he needs is macro that will take a list of find/replace pairs (eg: "Aida", a tab character, then "Aida, Y.") and run them all on an existing document (in this case, his already generated index). I'm attaching such a macro. Basically you will want to:

1. Open the document that needs fixing (eg: where you want the replacements to be made).
2. Run the macro, which will prompt you to select a file containing the list of find/replace pairs
(this file/list should have one pair per line, where the search text is separated from the replacement text by a tab character)
3. Let the macro do the rest.

If I've misunderstood, please let me know.
Attachments
Batch Replace Using List.nwm
(24.45 KiB) Downloaded 507 times
skcryan
Posts: 26
Joined: 2011-04-21 05:31:15

Re: replacing index entries

Post by skcryan »

Thanks. That's perfect. And apologies for the lack of clarity in my explanation. That's what going through a 150,000 document manually indexing names can do to you; you lose the ability to think straight or form an articulate sentence.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: replacing index entries

Post by martin »

Excellent- I'm glad the macro did the trick, and happy to help!
Post Reply