When finding in files is it possible to show more than one line?
-
I looked around through AI and Google and did not see a solution to this. So apologize if this is an old rathole. However when searching using Find In Files. I would like to see more text above and/or below the keyword I am searching for. I am gathering with the default implementation of Notepad++ that is not possible but wondering if there was a plugin to help with this perhaps? Support for multiple keywords would be an additional plus.
I was looking at some other off the shelf tools and Notepad++ would be a better place to execute this type of search imo. The file extensions I am looking through are non-standard but do contain searchable text but the tool I looked at did not allow other non standard extensions. So Notepad++ had a leg up there.
Now if can get a bigger chunk of text surrounding the keyword returned. Problem is there are thousands of files I need to search through searching for the keyword “error” and I don’t have time to open each one to figure out more details about the error.
-
The Search Results panel is designed to only show one line per match (even if you do a search expression that matches text that crosses over lines, it will only show the first line of the match). There isn’t a way to increase context.
Support for multiple keywords would be an additional plus.
The existing regular expression (regex) feature already handles that.
- Find What =
\b(George|Gracie|whale)\b- the
\bmatches “word boundary” so it would matchGeorgebut notGeorgene, etc. - the
(...)makes a group - without this logical group, the\bwould have to be repeated at the beginning and end of each word, like\bGeorge\b|\bGracie\b|\bwhale\b - the
|means “OR” - translated to english, this Find What means “match a boundary, then
GeorgeorGracieorwhale, then another boundary”
- the
- Match Case = off
- Search Mode = Regular Expression
. matches newline= off

–
From our FAQ section, the Generic Regular Expression formula FAQ links to a post Generic Regex: Logic Gates for Regular Expressions which explains how to match lines with AND, OR, Exclusive-OR, and similar logical constructs. - Find What =
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