The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,858 other subscribers

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

One Response to “Windows “FIND” console app: how to *not* have the dashed line with the filename in the output”

  1. […] Windows “FIND” console app: how to *not* have the dashed line with the filename in the&n… […]

Leave a reply to When GExperts for Delphi 2007 does not install itself in Delphi on Windows Vista/7/8 « The Wiert Corner – irregular stream of stuff Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.