PREAMBLE
Description
Commandline tool to find text in files.
Intro
Use RUN dialog to start CMD. For that use keyboard combiation Win+r, type cmd and hit Enter button on your keyboard.
Next Level
cd c:\
md temp
OR
mkdir temp
cd temp
mkdir atempdir
type nul > filename.txt
dir
explorer .
echo New line of ascii characters in this text file > filename.txt
more filename.txt
OR
type filename.txt
echo Second line of text in this file >> filename.txt
echo Third ^(3rd^) line >> filename.txt
more filename.txt
echo how you already noticed^, to write a special character^, you must at first use a Caret^^ sign >> filename.txt
more filename.txt
(echo 1st & echo 2nd & echo. & echo 4th) >> filename.txt
more filename.txt
(echo. & echo. & echo Text & echo Another text) >> filename.txt
more filename.txt
findstr /S /N /B New *.*
Where
/S - Searches the current directory and all subdirectories
/N - Prints the line number of each line that matches
/B - Matches the text pattern if it is at the beginning of a line
*.* - all files with all extensions
findstr /L /N /S /I line *.*
Where
/L - Processes search strings literally
/N - Prints the line number of each line that matches
/S - Searches the current directory and all subdirectories
/I - Ignores the case of the characters when searching for the string
*.* - all files with all extensions
findstr /?
for HELP
Last thoughts
Comments
Post a Comment