Windows “FIND” console app: how to *not* have the dashed line with the filename in the output
Posted by jpluimers on 2014/03/06
When using the Windows FIND console application, it will insert a dashed line
C:\Users\Developer>echo Foo > %temp%\foo.txt
C:\Users\Developer>find "Foo" %temp%\foo.txt
---------- C:\USERS\DEVELOPER\APPDATA\LOCAL\TEMP\FOO.TXT
Foo
This is really annoying when using FIND to parse files, and redirect the output fur further processing.
But there is a way around it, as find will not emit the dashed line when it the input is not a file, but stdin:
C:\Users\Developer>echo "Foo" | find "Foo"
Foo
By using the TYPE console app, you can force find to use stdin:
C:\Users\Developer>type %temp%\foo.txt | find "Foo"
Foo
Problem solved (:
–jeroen






When GExperts for Delphi 2007 does not install itself in Delphi on Windows Vista/7/8 « The Wiert Corner – irregular stream of stuff said
[…] Windows “FIND” console app: how to *not* have the dashed line with the filename in the&n… […]