Community
    • Login

    Find line containing word and the next line below it

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 440 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors