Shuffle text lines
-
Hello,
Notepad++ can nicely sort text lines ascending or decending. What I was looking for is a functionality to shuffle text lines.
Did I just see it in np++? Or is there a plugin available that does this job?
Maybe by using something like this: https://en.wikipedia.org/wiki/Fisher–Yates_shuffleThank you and have a nice day
-
@Michael-Weet said in Shuffle text lines:
shuffle text lines
Welcome to the NPP forum. I first have to say your sentence “nicely sort lines ascending or descending” contradicts the request to “shuffle” especially when the link refers to a random sort.
You should be aware that an ascending or descending sort can easily be done with “Line Operations” which is under the “Edit” menu. However random sorts aren’t possible in NPP without additional help from plugins or one of the supporting programming languages.
Might I suggest you read the posts:
https://community.notepad-plus-plus.org/topic/16318/sorting-lines-evenly-in-document
as that might give you some direction.As a very rough simile to “randomness” considering grabbing 2 characters at different positions within each line, copying these to the start of the line, then sorting. Then those characters could be removed, thus leaving a “sort-of” random ordering of the lines.
Terry