On Tue, 29 Jun 2010 00:58:54 +0900, Kino <[log in to unmask]> wrote:

>On Jun 27, 2010, at 6:46 PM, Hamid Haji wrote:
>
>> It is possible to have a NWP macro which can merge two index files created
>> in NWP?
>> 
>> Index file 1:
>> apples 1, 3, 10, 30
>> bananas 3, 6, 10
>> 
>> Index file 2:
>> apples 31, 33, 40, 43
>> bananas 33, 36, 41
>> 
>> Merged file:
>> apples 1, 3, 10, 30-31, 33, 40, 43
>> bananas 3, 6, 10, 33, 36, 41
>
>Here is a macro for that. Before running it, you have to change the
character "Before Page Number" in your index files from space to tab or
something unique, i.e. never used in entries nor in Page Number Separator.
The language of the caret in the active document is used to determine the
sort order. Sub-entries are not supported.
>
[...]

Wow! Thank you, Kino.

I tested the macro on both Roman and Arabic (after changing the page number
separator) index files and it works as expected.

I noticed that some index topics did not appear in the merged file. This
happens when a topic includes sequential page number references showing the
first and the last of the sequence as:

apples	10–11, 120–124

The same topic is included in the merged file if the sequential page number
references are given separately as:

apples	10, 11, 120, 121, 122, 123, 124


Hamid