Community
    • Login

    Multi-level data sorting

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 5 Posters 3.4k 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.
    • Elise BaribaultE
      Elise Baribault
      last edited by

      I have a text file with 6 columns and 2,097,152 rows. I need the first three columns to be sorted in ascending order. I need the corresponding columns to remain in tact. I cannot just sort the columns individually. I need a “layered” sorting, like in Excel. However, the number of rows exceeds the maximum limit in excel. Can Notepad++ do this or do I need to find another program?

      Terry RT dinkumoilD 2 Replies Last reply Reply Quote 0
      • Terry RT
        Terry R @Elise Baribault
        last edited by

        @Elise-Baribault said in Multi-level data sorting:

        I need a “layered” sorting, like in Excel.

        Well Notepad++ has line sorting. It just sorts based on the characters in sequence across the line. It can do it numerically or lexicographically (alphabet) and ascending or descending.

        The first issue I think might be a problem is the size of your file. It might exceed the ability to complete the sort, so if trying it, please give it time to complete.

        The second issue may be related to how the columns are created, is it by comma delimited, or is it fixed width?

        I’d say just give it a go, you can’t cause any permanent problem for the file, unless you do save after sorting. If in doubt use a copy of the file. I’m not on a PC currently but I think the sort function is under “Edit”, then “Line operations”.

        Terry

        1 Reply Last reply Reply Quote 0
        • dinkumoilD
          dinkumoil @Elise Baribault
          last edited by

          @Elise-Baribault

          There is a plugin that can do what you want. The only prerequisite is that the columns of your file have fixed widths, comma or tab separated columns are not possible.

          The plugin is not part of the official plugin list. Its repository is >> here << (to obtain further information you could have a look at the website noted under More information at), downloads (also as 64 bit version) you can find >> here <<.

          To manually install the plugin in recent versions of Notepad++, create a directory NppColumnSort under <Npp-install-dir>\plugins and copy the file NppColumnSort.dll to this directory.

          After restarting Notepad++, go to (menu) Plugins -> Column sorting -> Set criterias, define point-of-start and width of your columns and hit the Sort button.

          Of course I have not tested if the plugin is able to handle your huge data file, this is up to you. Maybe it could be helpful to use a 64 bit version of Notepad++ and the NppColumnSort plugin.

          1 Reply Last reply Reply Quote 3
          • AdrianHHHA
            AdrianHHH
            last edited by

            On Stack Overflow I wrote about a way of sorting a file using multiple criteria, see https://stackoverflow.com/a/60618065/546871. I have sorted big files using Notepad++ without problems, but I do not recall how their size compared to your file.

            1 Reply Last reply Reply Quote 1
            • guy038G
              guy038
              last edited by guy038

              Hello, @elise-baribault,

              Could you provide us with a sample of your Excel table ? I mean : a block of 15-30 rows to get a general idea of your data ?

              Please, copy your text as raw text. When replying :

              • Click on the option, mentioned in the image below

              20f5d2f4-8071-4233-b6f6-c661e2393159-image.png

              • Delete the single line code_text

              • Paste your data


              Thanks for your cooperation ! See you later,

              Best Regards,

              guy038

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