Index in ASCII sort order?

Asked by Lee Stewart

I need to have my alphabetical index sorted in ASCII order. There seems no way to do this in LO Writer v3.3.2. Does anyone know how? Can I write a script for a new "language" (English-ASCII) to select in setting up the index?

...lee

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu libreoffice Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
marcus aurelius (adbiz) said :
#1

you can search google for an ASCII chart. ASCII is standard. usually the uppercase letters come first, followed by the lowercase, then punctuation symbols

unicode might sort differently

Revision history for this message
Lee Stewart (g-kee-t) said :
#2

You do not understand the question. I know the ASCII sort order intimately. I need the LibreOffice Writer indexing facility to know it and to sort the index in that order. It is not currently one of the language options in the "sort" section of the Index setup dialog.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3
Revision history for this message
Lee Stewart (g-kee-t) said :
#4

Mine is not a database problem. That I can solve. It would be nice if there were a repository of language-sort-order files (or single file with such sections) that Writer uses that I could add to. I guess I am looking at delving into the source for Writer to see what's going on; but, I was hoping to avoid that.

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Lee Stewart (g-kee-t) said :
#6

Perhaps I posted this question to the wrong forum topic. Could someone steer me to a topic where someone might actually know something about my question?

...lee

Revision history for this message
Tony Pursell (ajpursell) said :
#7

Hi Lee

Tell me, exactly what is the difference between the sorted order that you get and the ASCII order that you want.

Tony

Revision history for this message
Lee Stewart (g-kee-t) said :
#8

ASCII order, beginning with "space" (SP) and ending with "~", is:

SP, !, " #, $,%, &, ', (, ), *, +, , (comma), -, ., /, 0 - 9, :, ;, <, =. >, ?, @, A - Z, [, \, ], ^, _, `, a - z, {, |, }, ~

The order that the Writer index utility uses is:

0 - 9, a - z, A -Z, all punctuation (but not ASCII order)

...lee

Revision history for this message
Tony Pursell (ajpursell) said :
#9

Hi Lee

I asked about this in the Forum:-

http://user.services.openoffice.org/en/forum/viewtopic.php?f=7&t=43491

I see now that you did that also.

Maybe the last suggestion to sort using a text editor may be the only way.

Unfortunately I have drawn a blank on any simple solution.

Tony

Revision history for this message
Lee Stewart (g-kee-t) said :
#10

I am not sure there is a way to sort the index outside of the indexing facility of Writer, text editor or otherwise. The only extra file created by the indexing facility is the concordance file. It is separately editable, but does not affect the sort order in any way.

...lee

Revision history for this message
Tony Pursell (ajpursell) said :
#11

I have been experimenting, with this file i have called index.txt

D 1 one
c 2 two
~ 3 three
a 4 four
: 5 five
A 6 six

(the fields are tab separted)

If I run (in a terminal)

sort --key=1,1 index.txt

I get

~ 3 three
: 5 five
a 4 four
A 6 six
c 2 two
D 1 one

Clearly not ASCII and exactly what I got when I sorted the same data in a table in LibreOffice. So following the note in the manual entry for sort, I set the environment variable LC_ALL=C with

export LC_ALL=C

then ran the sort again, and got

: 5 five
A 6 six
D 1 one
a 4 four
c 2 two
~ 3 three

which I believe is ASCII. So the conclusion is that it is possibly the environment that LibreOffice is run in and not LibreOffice itself that determines the sort sequence. However, starting LibreOffice from the command line with that environment variable set does not change the sorting, but this does show you the way you would have to go to sort the data externally.

So this is about as far as I can go with this.

Tony

Revision history for this message
Lee Stewart (g-kee-t) said :
#12

Thanks, Tony, but that's not going to work in this case because there is no file or table to sort. Of course, one thing I could do would be to block and copy the Index to another spot where I could manipulate it to my heart's content. The trouble with this is that I would have to do that every time I made a change to the Index. If I really want an index, that may be my only choice.

I am looking for a way to get Writer to do it automatically, which is surely possible because of all the language choices available in the Index dialog box. There must be a way to hack this.

Thanks, again, Tony.

Anyone else?

...lee

Revision history for this message
Tony Pursell (ajpursell) said :
#13

If there is a way to hack it, then I don't know it. Not my area of expertise, I'm afraid. There might be a LibreOffice developer's mailing list or IRC channel where you could get this type of help. Look at

http://www.libreoffice.org/get-involved/developers/

I would try IRC first.

Tony

Can you help with this problem?

Provide an answer of your own, or ask Lee Stewart for more information if necessary.

To post a message you must log in.