Notepad++ Problem with sorting lines
-
Hi,
I have this line:Line1-10 - Art
Line11-20 - Biology
Line21-30 - Film
Line31-40 - Geography
Line41-50 - History
Line51-60 - IT
Line61-70 - Science
Line71-80 - SportThis is what I need:
Line1 - Art
Line2 - Biology
Line3 - Film
Line4 - Geography
Line5 - History
Line6 - IT
Line7 - Science
Line8 - Sport
Line9 - Art
Line10 - Biology
.
.
.
.
etc. -
I would do:
Find:
^Line\d+-\d+
Replace:Line
Search mode: Reg ExpressionThen, follow that up with inserting a column of ascending digits (see the Column Editor on the View menu).
-
yes, @Alan-Kilborn 's suggestion seems to be the best and easiest way to do so.
if you need help on the column editor:
once you’ve run alan’s regex with “replace all”, hold the [alt] key and mark (draw) a cursor-line from the end of the first wordLineto the end of the last wordLinelike shown at the screenshot below.
then open column editor, select number to insert, with initial number 1 and increase by 1, and hit ok.

after that, you list will look like this.

-
If you have a lot of lines, you may end up with space(s) between
Lineand the (first) number. Use the following to remove those:Find
^Line\h+(?=\d)
ReplaceLine
Again, search mode is Reg Exp