• Login
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.
  • E
    Elise Baribault
    last edited by Jul 9, 2021, 4:20 AM

    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?

    T D 2 Replies Last reply Jul 9, 2021, 4:55 AM Reply Quote 0
    • T
      Terry R @Elise Baribault
      last edited by Jul 9, 2021, 4:55 AM

      @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
      • D
        dinkumoil @Elise Baribault
        last edited by Jul 9, 2021, 8:15 AM

        @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
        • A
          AdrianHHH
          last edited by Jul 9, 2021, 9:16 AM

          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
          • G
            guy038
            last edited by guy038 Jul 11, 2021, 12:00 AM Jul 11, 2021, 12:00 AM

            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
            4 out of 5
            • First post
              4/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors