Finding the nth character in a word

Is there a way to easily find the nth character in a document comprised of one extremely lengthy word? This would be similar to isolating a specific digit of pi in a document that has one million characters but only one “word” in it.

If this is a function already possible within this program, I would appreciate some advice on how to make use of it.

I’m using Win11 and LibreOffice ver. 26.2.5, document saved in .odt format.

Please give some context to your question. Why do you want to extract the nth caharacter? Which typographical effect do you want to achieve? How is this related to your document formatting (which is the primary goal of Writer)?

And don’t forget to mention OS name, exact LO version and save format.

I have multiple documents of very long single “word” hexadecimal values (10k, 50k, 100k, 250k, 1m) and I want to be able to quickly pick out a single, specific character from that sea of numbers. This has nothing to do with formatting or typography, only being able to easily identify which character is the 19574th out of 50000.

As for the “why”, I have a really big number, a mathematical godlike “Living Number”, that is important to some fiction I’m writing and being able to pick out specific-place values within that number will make my job easier.

Sub findCharByPosition()
p = Val(InputBox("Enter:0","Position", "0"))
tDoc = ThisComponent
cCtrl = tDoc.CurrentController
cur = tDoc.Text.createTextCursorByRange(tDoc.Text.Start)
cur.goRight(p-1, False)
cur.goRight(1, True)
MsgBox(cur.String)
cCtrl.select(cur) 
End Sub

This is helpful, thank you. Is there a way to format this so that it will also put my cursor at that character or otherwise navigate me to it?

The last line of the provided Sub does it.

Oh I see now, thanks! I’d used it from the input window rather than from within the document, so I hadn’t noticed this when clicking back into the Writer window to see where I had ended up.
Thank you very much for your help!

https://sourceforge.net/directory/hex-editors/

Not looking for any kind of hex editor.

probably have to revisit this if you actually expect Writer to cope with any kind of 1m-long sea :face_with_thermometer: