Jump to content

Windows grep?

Go to solution Solved by CallisterUK,
On 8/23/2016 at 0:57 AM, Mr_KoKa said:

findstr (https://technet.microsoft.com/en-us/library/bb490907.aspx) looks like can do what you want, especially this:

maybe excluding  "> results.out" part so the result will show up in console instead being written to file.

Sorry for the late reply.

This seems to be my last resort:

 

so, we have:  findstr /g:finddata.txt /f:filelist.txt > results.out  as the test.

 

Run>CMD(as admin).

My files: findstr /g:needtoget.txt /f:needtotest.txt  this is correct, right?

 

 

Error message in CMD = Cannot read strings from needtoget.txt (both files are on my desktop).

Googled it, can't seem find a clear fix. Any help is appreciated.

This was because my .txt files, weren't in C:/Users/User (in my case).

THE ABOVE ERROR IS FIXED WITH IT'S SOLUTION.

 

New error message: "Find: Invalid Switch"

THE ABOVE ERROR IS FIXED. I entered it incorrectly on CMD lol. 

So, imagine this. I have a huge .txt file with thousands of words (emails, passwords, ips), anything. Just looking for an example.

 

I have another .txt file with maybe 20-30 words. I want to search these 20-30 words, and see if I can find them in the huge .txt file

 

I've found a program called WindowsGrep, but I'm not sure if it's safe / will be fit for purpose. I'm essentially trying to find more than one thing at a time, in a TXT document.

 

Update: I've downloaded GrepWin, works fine for single-searches. Has the ability to multi-search, but I'm currently having issues with it.

Link to comment
https://linustechtips.com/topic/647433-windows-grep/
Share on other sites

Link to post
Share on other sites

findstr (https://technet.microsoft.com/en-us/library/bb490907.aspx) looks like can do what you want, especially this:

Quote

If you want to search for several different items in the same set of files, create a text file that contains each search criterion on a new line. You can also list the exact files you want to search in a text file. To use the search criteria in the file Finddata.txt, search the files listed in Filelist.txt, and then store the results in the file Results.out, type the following:
findstr /g:finddata.txt /f:filelist.txt > results.out

maybe excluding  "> results.out" part so the result will show up in console instead being written to file.

Link to comment
https://linustechtips.com/topic/647433-windows-grep/#findComment-8329908
Share on other sites

Link to post
Share on other sites

3 minutes ago, Mr_KoKa said:

findstr (https://technet.microsoft.com/en-us/library/bb490907.aspx) looks like can do what you want, especially this:

maybe excluding  "> results.out" part so the result will show up in console instead being written to file.

Is this using Command Prompt though? I feel as if I'd lose my mind using that. Looking for a program with an easy simple GUI.

Link to comment
https://linustechtips.com/topic/647433-windows-grep/#findComment-8329929
Share on other sites

Link to post
Share on other sites

how are the txt files laid out? one entry on each line or something else? Thinking you could do this in python quite easily 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/647433-windows-grep/#findComment-8331893
Share on other sites

Link to post
Share on other sites

32 minutes ago, CallisterUK said:

Do you need FileSeekPro for multisearches? as that's my main intention.

Possibly, though you might just be able to open a new window - the restriction just talks about using multiple tabs. I'm not using Windows right now, so I can't test it, but you could download the free version and see whether it meets your needs.

HTTP/2 203

Link to comment
https://linustechtips.com/topic/647433-windows-grep/#findComment-8333872
Share on other sites

Link to post
Share on other sites

21 minutes ago, colonel_mortis said:

Possibly, though you might just be able to open a new window - the restriction just talks about using multiple tabs. I'm not using Windows right now, so I can't test it, but you could download the free version and see whether it meets your needs.

Yeah, I've downloaded and using the PremiumTrial or something. The "query" is obviously what you're going to search, it's perfect for searching 1 at a time, and yes opening a new tab and starting another search simultaneously works. But it's still not 100% what I'm looking for. 

 

What's the difference between:

Query is Text Query and Query is RegEx

Link to comment
https://linustechtips.com/topic/647433-windows-grep/#findComment-8333979
Share on other sites

Link to post
Share on other sites

2 minutes ago, CallisterUK said:

Yeah, I've downloaded and using the PremiumTrial or something. The "query" is obviously what you're going to search, it's perfect for searching 1 at a time, and yes opening a new tab and starting another search simultaneously works. But it's still not 100% what I'm looking for. 

 

What's the difference between:

Query is Text Query and Query is RegEx

A text query means that it just looks for the exact text that you specify (I'm not sure, but it's possible that it supports some extra features like * and ? wildcards), while a regex query means that what you enter is a regular expression, which is a way of matching content that is more complex. For example, l(inus)?t(ech)?t(ips)? would match ltt or linustechtips, while 1(,?000)+ would match 1000, 1000000 or 1,000,000,000, but not 1 or 100. You can do much more complicated things with it too, though you're less likely to want to use something very complicated when just searching text. A good website for learning more about regexes is https://regex101.com/

HTTP/2 203

Link to comment
https://linustechtips.com/topic/647433-windows-grep/#findComment-8334021
Share on other sites

Link to post
Share on other sites

On 8/23/2016 at 0:57 AM, Mr_KoKa said:

findstr (https://technet.microsoft.com/en-us/library/bb490907.aspx) looks like can do what you want, especially this:

maybe excluding  "> results.out" part so the result will show up in console instead being written to file.

Sorry for the late reply.

This seems to be my last resort:

 

so, we have:  findstr /g:finddata.txt /f:filelist.txt > results.out  as the test.

 

Run>CMD(as admin).

My files: findstr /g:needtoget.txt /f:needtotest.txt  this is correct, right?

 

 

Error message in CMD = Cannot read strings from needtoget.txt (both files are on my desktop).

Googled it, can't seem find a clear fix. Any help is appreciated.

This was because my .txt files, weren't in C:/Users/User (in my case).

THE ABOVE ERROR IS FIXED WITH IT'S SOLUTION.

 

New error message: "Find: Invalid Switch"

THE ABOVE ERROR IS FIXED. I entered it incorrectly on CMD lol. 

Link to comment
https://linustechtips.com/topic/647433-windows-grep/#findComment-8341184
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×