How to shuffle words in lines randomly in Notepad++

Install the PythonScript plugin
- Go to the Plugins menu and select Plugin Admin.
- Find PythonScript in the list of available plugins and install it.
- Restart Notepad++ after installation.
Now you need to create a Python script that will shuffle words in lines. To do this:
- Go to the Plugins menu and select PythonScript, then Show Console.
- In the opened console, select Script and New Script.
- Name the script, for example, shuffle_words.py.
- Insert the code into the editor:
import random def shuffle_words_in_line(line): words = line.split() random.shuffle(words) return ' '.join(words) editor.beginUndoAction() for i in range(editor.getLineCount()): line = editor.getLine(i) shuffled_line = shuffle_words_in_line(line) editor.replaceLine(i, shuffled_line) editor.endUndoAction()
Run the script
- Open the file where you need to shuffle the words.
- Go to the Plugins menu, select PythonScript, and then Scripts.
- Find and run the shuffle_words.py script by clicking on its name.
The script will shuffle words in each line of the selected file.