libreofficelibreoffice-calcword-processor

How to generate list of words in Libreoffice calc


Basically I need to populate a column with created new words in this format (??P??P) or (??K??K), "?" is wildcard. If possible I would want the 2nd and 5th letters to be vowels. I also want to be able to change the expression (??P??P) to (??X??X), X can be any letter. I tried finding commands for this in "customise menu" and in the "insert menu" options. I tried to find expressions for this in "Regex command" documentation in Libreoffice documentation. I am not a technical person, so I do not have the ability to create scripts for this. Any help is appreciated.


Solution

  • Such "words" are not difficult to generate. To get a random integer use the RANDBETWEEN() function

    Now, using the CODE() function, find out the code for the letter "A", add a random number from 0 to 25 to this code, and convert it back to a letter using the CHAR() function:

    =CHAR(CODE("A")+RANDBETWEEN(0;25))

    This will give you one random letter.

    To get a random vowel letter (or any letter from a predefined list) list all the desired letters in one line and pull out one random letter using the MID() function

    =MID("AEIOU";RANDBETWEEN(1;5);1)

    Letters that should remain unchanged in the template, specify explicitly - just put the letter in quotation marks: "P", "K", "X"

    Now you have all the necessary parts for the formula, connect them using the CONCAT() function or just using the ampersand sign &

    =CHAR(CODE("A")+RANDBETWEEN(0;25)) & MID("AEIOU";RANDBETWEEN(1;5);1) & "P" & CHAR(CODE("A")+RANDBETWEEN(0;25)) & MID("AEIOU";RANDBETWEEN(1;5);1) & "P"
    

    Result