How can I filter duplicate words in a text file down to a single word and store it in a variable?

@Famui_Yanisa

If you got the solution for your query. Please mark it as solution to close the thread and others also helped.

Regards,