Random Word Generator

Hallo, please help me how I can count the words in a textfile where every word is seperated by a space. I need this to display randomly one of those words who are stored in a text or a variable.

Thank you for your help!

Best regards

Peter Tabbert