[SOLVED] i have a very long text file and im searhing only for spesfic sentences that have a word in it whats the best way to make those just show up?

Mitch_15

Reputable
Mar 31, 2017
84
0
4,530
i have a long text file and i dont want to go trough every thing to find what i need it would take me so long whats a easy way to just find what i need?
 
Solution
Use findstr at the command prompt.

Example:
findstr "location" "C:\users\Mitch\Desktop\TheFile.txt" > "C:\users\Mitch\Desktop\Only_Location_Lines.txt"

This will create a file on the desktop with all of the lines that have "location" in them (for example if your Windows user account name is Mitch). Be sure to use the correct path and filenames.

Note that
> "C:\users\Mitch\Desktop\Only_Location_Lines.txt"
redirects the output from the screen, and instead puts it in a file. You can leave that off if you want to see the output in the command prompt. That's a good way to test it first.
findstr "location" "C:\users\Mitch\Desktop\TheFile.txt"

Reference...

gardenman

Splendid
Moderator
Use findstr at the command prompt.

Example:
findstr "location" "C:\users\Mitch\Desktop\TheFile.txt" > "C:\users\Mitch\Desktop\Only_Location_Lines.txt"

This will create a file on the desktop with all of the lines that have "location" in them (for example if your Windows user account name is Mitch). Be sure to use the correct path and filenames.

Note that
> "C:\users\Mitch\Desktop\Only_Location_Lines.txt"
redirects the output from the screen, and instead puts it in a file. You can leave that off if you want to see the output in the command prompt. That's a good way to test it first.
findstr "location" "C:\users\Mitch\Desktop\TheFile.txt"

Reference: https://www.windows-commandline.com/findstr-command-examples-regular/
 
Solution