2

I've been working on a 3474 line table. Getting the information was easy, capturing the needed information from public online sources. But I came across a problem.

The table is by default sorted alphabetically, since the first item in the table is an alphabetical value (a toponym). It is then followed by a second, numerical value, and this is the value I need the table to be sorted by.

I need to sort it because I can't just publish a 3474 line table. I need to sort it by this numerical value, and then divide into several smaller tables, and then publish them on Wikipedia.

I was using Notepad for editing, but I got Notepad++ hoping I could find an easy fix, but no luck. Line example:

| Gorna Banjica (Gostivar) || 3436 || 839 || 811 || 1053 || 610 || - || 1 || - || 15 || - || - || 107

|-

| Mitrašinci (Berovo) || 555 || 519 || - || - || - || - || 1 || - || 1 || - || 1 || 33

|-

How can I do this? Any help is welcome, because sorting 3474 lines manually is going to take quite a while, and my daily schedule doesn't allow me to spend more than an hour working on the table.

1
  • 1
    It's not clear what you want to achieve, please, edit your question and add sample text and expected result.
    – Toto
    Commented Dec 17, 2023 at 10:43

1 Answer 1

1

Without installing add-ons, the only way to accomplish this using Notepad++ is to use its column mode to:

  1. Carefully select the correct column of numbers.
  2. Move the column by which you want to sort to the beginning of each line.
  3. Select all lines.
  4. Sort the selection as integers.
  5. Move the column back into its original position.

But the real issue is that you are attempting to use the wrong tool for the job.

Instead of using Notepad++, simply use LibreOffice Calc:

  1. Import your text document into LibreOffice Calc.
  2. Sort by any column you want (click the header for a column, then go to the Data menu, and select the Sort Ascending menuitem).

Done!

2
  • Unfortunately for me, the needed values are not located one over the other exactly. But I solved the problem by pasting the table into an edit page on Wikipedia, sorting the table in page, and then copying the html code for the table in Inspect Element. This worked because inspect element changes the code in real time, as the page itself changes. I then used the table converter by FechinLi, to convert the table from html to a wikipedia friendly format.
    – SoWhAt249
    Commented Dec 17, 2023 at 16:30
  • 1
    But thank you anyways.
    – SoWhAt249
    Commented Dec 17, 2023 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .