Menu

Can I select a huge number of lines easily?

2007-10-22
2012-11-13
  • Nobody/Anonymous

    Does anyone know a trick to do this?
    I have a log file of which I only want to keep certain parts or sections.

    I can search for the start of each section.
    But can I in some way mark the end of the previous section in a bookmark-kind-of-way, then search for the start of the next section and select all lines from the "bookmark" and delete all selected lines (in-between)?

    This would be a time saver for me.
    Anyone?

     
    • Nobody/Anonymous

      The way to go then would be:
      Search for the start of a section to keep.
      Hold the shift key and move the window back to the top by using the scrollbar.
      Then delete all lines.

      Next, move to the end of the section to keep.
      Search for the start of the next section to keep.
      Hold the shift key and move back up...

      I would have to remember the line numbers to be able to scroll back in a somewhat fast way.

      It would be of help if I could set something like a select-mode: auto-select all text from the current cursor position to where I am moving it, until I hit some action button to cut, copy, delete or undo selection mode.

      I could make use of the bookmarks then, or even skip them because of the easy search capabilities. The point is that I have to search for both the start and end of the block because they can be so big...

       
    • MMTsuchi

      MMTsuchi - 2007-10-22

      One trick : (with no bookmarks)
      you place the cursor at the beginning of the block you want to delete,
      you navigate to the end of the block you want to delete, WITHOUT moving cursor,
      you press "maj" key + click at th end of the block.

      This is not what you want, i know, but it is near.

      Sorry for my english, I'm french.