Community
    • Login

    Shuffle text lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Michael WeetM
      Michael Weet
      last edited by

      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_shuffle

      Thank you and have a nice day

      1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R
        last edited by

        @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

        1 Reply Last reply Reply Quote 4
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors