Select/mark all lines which contain a certain pattern and add the line above
There is already a topic but I wanted to start a new thead to “add the line above”:
I’m not sure how to copy a line using the bookmark feature yet, but I want a bookmark to be added to every line above what I have already bookmarked as a result of edit>find>mark>bookmark line>mark all.
how to copy a line using the bookmark feature
Search menu > Bookmark > Copy Bookmarked Lines
I want a bookmark to be added to every line above what I have already bookmarked
You can’t do this based solely on the bookmarks. You can, however, craft a mark search expression that will bookmark a line of interest and the line above that one.
If you have already created
YOURREGEXto mark data, if you want to bookmark the line it is on plus the line above, you could use a Find what box of:
(?-s)^.*\R.*?and then append
Example: Bookmark line containing
fooand then line above it:
(?-s)\R.*?fooworks but there will only be a bookmark on the “line above”, no red coloring of the text. I like the red coloring so I prefer the first version.
I just expanded my search to include the line above, not sure if this is what you meant. I don’t know about “craft an expression”. I also have no clue about your last reply. My problem is solved though so thanks.
I don’t know about “craft an expression”
I also have no clue about your last reply.
Sorry, I should have been more explicit.
My comments were in regard to “Regular Expression” Search mode, which is typically what one is inferring when they ask “how can I manipulate data that is relative to some other data”.
As you’ve probably discovered, you can, in Normal Search mode, bookmark the “line above” by making a selection that covers both lines, perhaps partially, and then pressing ctrl+f go get your text in the Find what box. You can then switch the Find window to the Mark tab and proceed with bookmarking.
But if you do it that way, you aren’t truly doing “line above”, you’re doing “line of” and “line below”. :-)