Replace large list of words (macro?)

I have documents where I need to replace a list of over 300 words, either with proper capitalization, style and/or spelling. These words are part of a story, so they would be part of paragraph content in Writer. Ex: “Tim loren” to "Tim Lorren. "
I read here, and sort of understand it.

Would it be easier to record a macro and edit what’s made? I know zero about coding languages/macros.

Updated 12/31/24

a number ?

for example ?

What kind of “list”?

  • Comma separated, semicolon separated, tab separated …?
  • One line per word) One paragraph per word?
  • A TextTable column? More columns?

To know answers to the questions above, and to those signaled by @fpy is substantial for a reasonable attempt to help.
There is no magician or clairvoyant at work here.

I added the details

I’ve added details in the main question

I think this would be three separate macros?

Still no clue.

Where is the list? In what way are the needed changes defined in every case for the words of the list?

The list is saved in a file I reference, I usually find and replace. One word at a time. I had AI generate a macro (for study), so I have that saved too.

In my home country (Bavaria) I would now say (in German) “Do I have to pull everything out of your nose like worms?”

Why don’t you simply attach small example files since now is clear that there must be two of them, one just containg ordinary text, and one “the list”?

I’m sorry for my confusion and the delay. These are Harry Potter words I’m trying to fix.
HP word list.pdf (25.3 KB)

I definitely can’t make sense of what you are presenting.

  • A .pdf file is the most inapt means to keep a list on which something you might want to achieve can be based.
    Just to transform it to something “usable” in the supposed sense would cost a lot of time.
  • If intended replacements shall be described you need a table, best created in a spreadsheet, but possibly also in a TextTable with at least two columns: SearchFor and ReplaceWith.
  • Even having that, there are general problems with successive replacements which you obviously didn’t take in account.

II would need to first absolve “Hogwarts School of Witchcraft and Wizardry” to be able to do what you (supposedly) want.

I may be using the word “list” wrong. It didn’t take long to put this into tables.

If “this” is the file you attached (HP word list.pdf) that’s interesting.
How did you do it?
Where is the table?

There isn’t one. Right now, it’s copy/paste F&R individual terms, or checking the PDF when I see a possible misspelling.

May be this will help for correcting spellings. It is not useful for replacing styles.

Install that macro and then type the find/ replace list of your 300 words in a new file using the following format:

loren: Lorren,
teest: test,

Now use the shortcut Ctrl + Shift + F9 so that these words will be added to your auto-correct list. Restart Libreoffice and then apply the list using Tools - Autocorrect option.

1 Like

may also come built in : Adding .dic files - #10 by Wanderer

not sure how robust it is though : 156833 – Inconsistent phrase checking

I’m sure The Capitalization the letters with some automatic algorithm will not give the 100% correct results. You have for example Wolfsbane Potion and Gigantic jellyfish and I’m not able to recognized why Potion is with uppercase P and jellyfish with lowecase j. But my knowledge of English is limited and the names of fantasy creatures I will not riddle :-).
But never mind, it seems you have the list of Capitalized words, so you can add your data to tables for F&R in ODT and test it.
replaceViaTables.odt (28.8 kB)

But control firstly your lists, you used the comma separated list in PDF, but there is for example Injuries, 12, Grimmauld Place and it returns 3 words although the 12 doesn’t seem as Name or Capitalized word. Or the Array4 also doesn’t seem as a name of some bogeyman :-).

Thank you so much! I’m not sure where Array4 came from, so it’s been removed as I edit the list. :slight_smile: