Registered Member
|
The command "locate lmms" on the terminal gave me a lot of output, therefore I had to save the output in a file.
I opened the file on Kate and there are 4,640 lines of code. How can I select all lines from 2-2,633? Once I have them selected I can delete them and concentrate on the other lines. |
Registered Member
|
First you should be able to just scroll to the start location (or use ctrl+g to go to a specific line) and use shift+up/down/pageup/pagedown/etc or shift-mouse-click to select the couple-hundred line chunk you want to remove and then hit delete. (I don't know of any keyboard shortcut to select from here to another specific line number; but I assume you were already scrolling around the file to figure out the start and end lines you wanted to remove).
If there's a common sub-string in the lines you want to remove, you can use kate's regex-based find-and-replace to remove those lines. In the dialog, ensure Mode is set to Regular expression, then in the Find box you can use a find expression like: .*commonText.*\n to find all lines which contain 'commonText', then (with an empty Replace field) hitting Replace All should remove all of them (the ".*" bit is a wild-card expression that matches anything except new-lines) (If you right-click in the Find box, there's an Add menu which shows the other regex elements you can add to the search criteria).
airdrik, proud to be a member of KDE forums since 2008-Dec.
|
Registered Member
|
If you have to cut lines often, you can try using a sed:
|
Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]