Ask Your Question

Get the character count from LibreOffice writer, measured from the 1st line to a given line number?

asked 2018-02-16 18:15:10 +0100

konstantin gravatar image

I would like to make similar videos of scrolling text, which is syncronous with the reading voice: It is difficult to ensure, that the current line let be always in the scrolling window, preferably in the middle. Currently I can generate only a steady scrolling of a constant speed. For this reason I have to ensure that the text contains about the same number of letters in every state of the scrolling window, line by line. So I would like to format my text to ensure this criteria, by dividing the text into more paragraph, setting the before- and after paragraph spacing, or even adding empty paragraphs with spacing. I have to do this because the text usually contains dialogues, which contain fewer characters, this is why I have to decrease the average number of letters in the other paragraphs which don't contain dialogues. This way I could equalize the character count through the whole text, which take place in the current state of the scrolling window.

My problem is that how can I query the character count from top of the text to a given line number ( count of vowels would be even better ) ? Drawing an interactive cumulative distribution of the line-by-line letter count would be optimal for me (or equivalently character counts of the line-by-line scrolling window states). Should I use the internal BASIC interpreter to get this information? Any guidance would be welcome.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-02-16 18:38:09 +0100

Lupp gravatar image

updated 2018-02-16 19:08:34 +0100

Find & Replace
Regular expressions enabled
Find: [aeiouäöü] (In square brackets all the characters you want to count as vowels; I did it for German.)
Replace: & (Meaning: Replace with what you just found.)
Replace All (May need some time.)

Above the Replace: line you will be informed how often something was replaced.

(I don't know what maximum number of replacements is accepted. My extreme example was 30p with 39510 vowels. The process took about 37 s on my system.)

Just tested: A primitive user Sub for the task tried on 120p with 4 times the above used text and thuis with 158040 vowels needed 6.0 s for the counting.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-02-16 18:15:10 +0100

Seen: 111 times

Last updated: Feb 16 '18