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=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
-
@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!!