Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a text file with 200.000 lines - how to select multiple lines, before I delete them ?

Manual work is too dificult for, say, 65.000 lines.

share|improve this question
4  
select them by what criteria? You'd have better luck using a regex or such, but without more information its hard to give a specific, useful answer –  Journeyman Geek Feb 15 '12 at 0:43
1  
Continuous or seperated lines? –  The_aLiEn Feb 15 '12 at 1:17
    
CTRL+mouse select can do something like what you want to do. –  Diogo Feb 15 '12 at 1:21
6  
Click on the starting line, scroll down to the ending line, hold the shift key, and click again. –  Daniel R Hicks Feb 15 '12 at 1:40
    
+1 @DanH That, i was going to.. –  The_aLiEn Feb 15 '12 at 2:18

2 Answers 2

Easiest way:

Ctrl+G, go to line 1

    Menu > Edit > Begin/End select.

Ctrl+G, go to line 65.000.

    Menu > Edit > Begin/End select.

You now have your range selected.


Answered:

http://stackoverflow.com/questions/8490968/select-range-of-lines-in-notepad

share|improve this answer

The shift+some direction control combo is pretty darned slow for thousands of lines/pages; so here's a fast solution...

# File:: selectGOTO.py
#   A N++ Python Script to enhance line selection speed compared to mouse, cursor, page controls.
#   Selects text from the [ start|end ] of current line to [ end|start ] of GOTO line.

# Install using:: Plugins -> Plugin Manager -> Python Script
# Create script using:: Plugins -> Python Script -> New Script -> "selectGoto.py"
# Add to menu:: Plugins -> Python Script -> Configuration -> [select script] [ add ]
# Create shortcut:: [Restart N++]
#   Settings -> Shortcut Mapper -> Plugin Commands -> selectGOTO -> [modify] [ctrl]+[shift]+[g]

# Simple usage:
#   [ctrl]+[shift]+[g] line#
#   Do your operation... (ie: del)

from Npp import *

class startAnchor:
    pos = 0

def selectGOTO( args ):
    endPos = editor.getCurrentPos()
    if( endPos > startAnchor.pos ):
        startAnchor.pos = editor.positionFromLine( editor.lineFromPosition( startAnchor.pos ) )
    else:
        tmp = startAnchor.pos
        startAnchor.pos = endPos
        endPos = tmp
    endPos = editor.getLineEndPosition( editor.lineFromPosition( endPos ) )
    editor.setSel( startAnchor.pos, endPos )
    editor.clearCallbacks()

def main():
    startAnchor.pos = editor.getCurrentPos()
    editor.callback( selectGOTO, [SCINTILLANOTIFICATION.UPDATEUI] )
    notepad.menuCommand( MENUCOMMAND.SEARCH_GOTOLINE )

main()
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.