Is there a way to use the everything search syntax to find specific text inside of a very large file ?

Discussion related to "Everything" 1.5.
Post Reply
shodan
Posts: 40
Joined: Wed Mar 17, 2021 8:40 am

Is there a way to use the everything search syntax to find specific text inside of a very large file ?

Post by shodan »

Hi,

I have a very large 159 megabyte file, and I want to use the everything search patterns to find one of the thousands of text

I tried text editors but their search syntax is too limited to find what I need.

My search is something like

"*dream*" (0 to 3 words) "*talk*" OR ("*talk*" (0 to 3 words) "*dream*" )

So can I use the content: syntax to do something like this ?

Maybe return line and column numbers of the results ?
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is there a way to use the everything search syntax to find specific text inside of a very large file ?

Post by void »

Everything will only tell you if the search text was found.
Not where the search text occurred.

You will need to use regex:

regex:content:"\b(dream(\s+\w+){0,3}\s+talk|talk(\s+\w+){0,3}\s+dream)\b"


\b == Word boundary.
(\s+\w+){0,3} == Matches 0 to 3 words.
\s+ == one space before terminating word.
| == OR



-If you are using Everything 1.5:

regex:content:"\b(dream(\s+\w+){0,3}\s+talk|talk(\s+\w+){0,3}\s+dream)\b" addcol:1


-This will show the matching text in Column Regmatch1.
shodan
Posts: 40
Joined: Wed Mar 17, 2021 8:40 am

Re: Is there a way to use the everything search syntax to find specific text inside of a very large file ?

Post by shodan »

Thanks that worked
image.png
image.png (39.84 KiB) Viewed 4421 times
However like you said, it does not indicate where or how many times

Maybe if I could chop that file up into multiple chunks
void
Developer
Posts: 19870
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is there a way to use the everything search syntax to find specific text inside of a very large file ?

Post by void »

Any text editor with regex search support might help.
I use Visual Studio, but that might be overkill for your situation.
Visual Studio will show each occurrence and the number of occurrences. (Ctrl + Shift + F)
Visual Studio Code should also work.

Another option:
Search for the regular expression Match 1 result from Everything in Notepad.
shodan
Posts: 40
Joined: Wed Mar 17, 2021 8:40 am

Re: Is there a way to use the everything search syntax to find specific text inside of a very large file ?

Post by shodan »

Thanks for the suggestion but notepad++ can't open such a big file.

I asked the AI and it suggested these

grep -P -n -C4 '\b(dream(\s+\w+){0,3}\s+talk|talk(\s+\w+){0,3}\s+dream)\b' yourfile.txt

pcregrep -M -n -C4 '\bdream(?:\s+\w+){0,3}\s+talk\b|\btalk(?:\s+\w+){0,3}\s+dream\b' yourfile.txt

I have grep on my windows pc but this syntax was wrong. (it's the cygwin one I think)

I"ll try on a linux computer when I get one !
Post Reply