Community
    • Login

    Find line containing word and the next line below it

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 117 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • deleeleeD
      deleelee
      last edited by

      I have an ini file that contains ‘tweaks’. They are entered in the file with a comment on one line explaining the tweak, then the tweak key/value on the next line.

      For example:

      ListSelectOnPasteInSamePath=1
      ListCheckboxSelectionMode=0
      ListCellsFirstLinesOnly=0
      ListAutoSelectFirst=1
      ; Tweak: right-padding of columns
      ListDetailsColumnsSpacing=3
      ; Tweak: left-padding of columns
      ListDetailsColumnsSpacingLeft=3
      ListsLineSpacing=2
      

      I assume I’ll need to use regex to do it but is it possible to do a Find All for only the tweak lines and their corresponding tweak key/value lines? Or by any other method if Find All isn’t the way to do it?

      The result for the example given would be:

      ; Tweak: right-padding of columns
      ListDetailsColumnsSpacing=3
      ; Tweak: left-padding of columns
      ListDetailsColumnsSpacingLeft=3
      
      Terry RT 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R @deleelee
        last edited by Terry R

        @deleelee said in Find line containing word and the next line below it:

        but is it possible to do a Find All for only the tweak lines and their corresponding tweak key/value lines?

        Well I’d go for a “Mark” with bookmark lines selected.

        Use:(?-s)^(?=.*tweak:)(.+\R.+\R) and click Mark All. All the tweak lines and corresponding following lines are bookmarked. Then you’d just copy the bookmarked lines to another tab.

        Terry

        deleeleeD 1 Reply Last reply Reply Quote 4
        • deleeleeD
          deleelee @Terry R
          last edited by

          @Terry-R said in Find line containing word and the next line below it:

          I’d go for a “Mark” with bookmark lines selected.

          Use:(?-s)^(?=.*tweak:)(.+\R.+\R) and click Mark All. All the tweak lines and corresponding following lines are bookmarked. Then you’d just copy the bookmarked lines to another tab.

          Thanks, Terry, perfect!!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors