Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

index file - sorting items

31 views
Skip to first unread message

Cees Mulder

unread,
Oct 23, 2009, 6:11:01 AM10/23/09
to
I am making an index file (MS Word 2007) where I sort out Article numbers.
In the document, I create an Index file named "b" comprising e.g. the
following items:
{XE "Art. 75" \f \b}
{XE "Art. 135" \f \b}
{XE "Art. 4" \f \b}
{XE "Art. 16" \f \b}
When the Index is generated, it shows:
Art. 134....page number
Art. 16....page number
Art. 4....page number
Art. 75....page number
I can understand why the sequence is as it is, but it is not what I desire.
The Index should look like - sorting the "numbers" only:
Art. 4....page number
Art. 16....page number
Art. 75....page number
Art. 134....page number
All items in the index start with "Art. " and this should always be visible.
The problem could be solved if the Index file could "overlook" the "Art. "
and ONLY sort the numbers...
My question is, is this possible...? And if so, how to proceed?
Thank you for your responses.

Robert M. Franz [RMF]

unread,
Nov 5, 2009, 9:34:23 AM11/5/09
to
Hello Cees

Cees Mulder wrote:
> I am making an index file (MS Word 2007) where I sort out Article numbers.
> In the document, I create an Index file named "b" comprising e.g. the
> following items:
> {XE "Art. 75" \f \b}
> {XE "Art. 135" \f \b}
> {XE "Art. 4" \f \b}
> {XE "Art. 16" \f \b}
> When the Index is generated, it shows:
> Art. 134....page number
> Art. 16....page number
> Art. 4....page number
> Art. 75....page number
> I can understand why the sequence is as it is, but it is not what I desire.
> The Index should look like - sorting the "numbers" only:
> Art. 4....page number
> Art. 16....page number
> Art. 75....page number
> Art. 134....page number
> All items in the index start with "Art. " and this should always be visible.
> The problem could be solved if the Index file could "overlook" the "Art. "
> and ONLY sort the numbers...

the problem is not the "Art. ", but that the index treats/sorts its
entries as character strings. You can create entries w/o the "Art. ",
but that will not solve the problem.

The only way I see is to include leading zeros in the article numers:
"Art. 004" is sorted before "Art. 016", etc.

HTH
Robert
--
/"\ ASCII Ribbon Campaign | MSFT |
\ / | MVP | Scientific Reports
X Against HTML | for | with Word?
/ \ in e-mail & news | Word | http://www.masteringword.eu/

Cees Mulder

unread,
Nov 11, 2009, 3:25:02 AM11/11/09
to

I have a problem with sorting of lists in index files. In a large Word-file I
generate several Index files, using:
{INDEX \f "b" \e " " \c "2" \z "1033"}
to generate index file named "b".
It sorts "articles of a law", like e.g.:
{ XE "Art.75" \f "b" }
{ XE "Art.135" \f "b" }
{ XE "Art.4" \f "b" }
{ XE "Art.18" \f "b" }
The resulting list looks like:
Art.135 .... page#
Art.18 .... page#
Art.4 .... page#
Art.75 .... page#
And that is not what I want although I understand what is happening (sorting
alphanumeric).
Is there a known solution to this problem? Could it e.g. be possible to
include the word "Art." in the Index file definition, which is always printed
- then only the "numbers" could be indexed...?

Cees Mulder

unread,
Nov 11, 2009, 4:01:02 AM11/11/09
to
Dear Robert,

Thanks for your reply - I had thought of this solution too - but the leading
"zero's" do not look so very "nice".
Anyhow, I tried this and then tried to set the leading "00" as hidden text -
but this did not work because the field codes are already hidden - and
"double" hidden is not possible...
I have a number of books here on my desk with perfectly sorted lists where
all the items start with "Art." or with "Rule" in the manner I desire. Or
even where case law numbers are perfectly sorted like "T19/87" before
"T105/87" and which is followed by "T12/89" if you see the problem (first
sortting for the year - then for the sequence number).
There must be other users doing this...?
There must be a solutuin for this in MS Word...?

My problem would already have been solved if I could include "Art. " in the
definition of my Index File such that each item starts with "Art. " followed
by a perfectly sorted list... This would make indexing an easier job. Is that
possible...?

Thank for any response, Cees

> .
>

Robert M. Franz [RMF]

unread,
Nov 17, 2009, 11:24:15 AM11/17/09
to
Hello Cees

Cees Mulder wrote:
> Thanks for your reply - I had thought of this solution too - but the leading
> "zero's" do not look so very "nice".

it's the only way I see (FWIW :-)) to get there without manual or
programmatic intervention.


[..]


> I have a number of books here on my desk with perfectly sorted lists where
> all the items start with "Art." or with "Rule" in the manner I desire. Or
> even where case law numbers are perfectly sorted like "T19/87" before
> "T105/87" and which is followed by "T12/89" if you see the problem (first
> sortting for the year - then for the sequence number).
> There must be other users doing this...?
> There must be a solutuin for this in MS Word...?

I've never played with TOA fields (they're next to unknown in the
language editions of Word I'm using, or in the document types created
therein), but maybe they can help here.


> My problem would already have been solved if I could include "Art. " in the
> definition of my Index File such that each item starts with "Art. " followed
> by a perfectly sorted list... This would make indexing an easier job. Is that
> possible...?

Well, you could create the index entries w/o the "Art. ", then manually
unlink the INDEX field and add the missing string to each line. This can
be done with a Find/Replace run. And it's possible to put that, and the
index unlinking, into a macro.

0.2¢

Cees Mulder

unread,
Jan 12, 2010, 6:00:01 AM1/12/10
to
Eventually, there appears to be a simple solution to the problem...
It is too simple that I am surprised that nobody came up with that suggestion.

Let me go back to my original question where I indicated that I want to sort

the following items:
{XE "Art. 75" \f \b}
{XE "Art. 135" \f \b}
{XE "Art. 4" \f \b}
{XE "Art. 16" \f \b}
When the Index is generated, it shows:
Art. 134....page number
Art. 16....page number
Art. 4....page number
Art. 75....page number

which is not what I desire...

But a friend told me that adding a ";" behind the reference followed by how
you want to sort is all that is necessary. Thus, in order to sort in the good
order one should add:
{XE "Art. 75; 075" \f \b}
{XE "Art. 135; 135" \f \b}
{XE "Art. 4; 004" \f \b}
{XE "Art. 16; 016" \f \b}

When the Index is generated, it shows:

Art. 4....page number
Art. 16....page number
Art. 75....page number
Art. 134....page number

As simple as that...

Robert: thanks anyway for you comments and advise...!

"Robert M. Franz [RMF]" wrote:

> .
>

Robert M. Franz [RMF]

unread,
Jan 12, 2010, 7:19:26 AM1/12/10
to
Hello Cees

looks highly undocumented AFAICT, but glad you found a working way.

Thanks for sharing!

Suzanne S. Barnhill

unread,
Jan 12, 2010, 8:36:16 AM1/12/10
to
That is surely undocumented and extremely useful. I wonder if it's possible
to do it with something other than numbers. It would certainly help with the
issues of sorting numeric items into alphabetical order and vice versa (for
example, where "2" needs to be alphabetized as if it were "two").

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Robert M. Franz [RMF]" <robert...@mvps.org> wrote in message
news:7r37me...@mid.individual.net...

0 new messages