David
David

Reputation: 1963

Select range of lines in Notepad++

Is there a way to select range of lines in Notepad++? I would like to write two numbers - from and to, say: from 10000 to 25000.

I've got this large MySQL dump file and I can select it only by using some function.

Upvotes: 63

Views: 90595

Answers (4)

Hani Yassine
Hani Yassine

Reputation: 31

put your cursor at the start of line 10000 then press and hold the shift key use the scroll bar to go to line 25000 and Right click at the end of it, this will select all the lines between 10000 and 25000, also while pressing and holding the shift key you can hold and drag the Right click to change selection area

Upvotes: 0

mandy
mandy

Reputation: 171

I was trying to figure the same thing out FOREVER! I finally figured it out. The closest answer I could get was CTRLg then ShiftPageUp.

But if you want to select more and not the whole page do go to the last line your wanting and press CtrlShiftHome. That will select from where you are to top of your text. The same goes for CtrlShiftEnd will select from what line you are at to the last line.

Upvotes: 17

BRPocock
BRPocock

Reputation: 13914

I don't know Notepad++, but as a quick solution, you can use

perl -ne 'print if $. >= 10_000 && $. <= 25_000' < file.sql > some-lines.sql

(The _ in numbers in Perl are just for legibility and can be omitted. It's like writing 10,000 in the US or 10.000 in Germany, but without the cultural confusion.)

Upvotes: 3

Ant&#243;nio Almeida
Ant&#243;nio Almeida

Reputation: 10087

Easiest way:

  1. Ctrl + G, go to line 10,000.

    • Menu > Edit > Begin/End select.

  2. Ctrl + G, go to line 25,000.

    • Menu > Edit > Begin/End select.

You now have your range selected.

Or, simply right click for "Begin/End select" option.

Upvotes: 95

Related Questions