Find line containing word and the next line below it
-
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=2I 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 -
@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
-
@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!!
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