Download
here's the source and executeables (DOS and Windows 32+64-bit) in a single findnot.zip file. It is under the GPL3 license. lsm file.
09/27/2010 12:51 AM 106,380 findnot.zip SHA512 findnot.zip 7d16dbaf23aca99e 8541cd72eea68907 9185e59c6c47e83f b1e0e8a5a4ca872e b77882c925886c22 13451c55cab7b1cd e0ea8fc691f1e544 8ba69df7d4618e85 MD5 findnot.zip d25219075af45bdd8661053a4c18be6d
Overview
You give this program a search string and a filepath, and it will search the text file for the string. if it is found, it returns failure (errorlevel 1) to the OS. if it is not found, it returns success (errorlevel 0) to the OS.
this is useful for batch files, and the unix find utility. for instance, find /prj -name ".html" -exec findnot "<div><br><br><br><a href=" {} ; -print
Think of this as the opposite of grep.
imagine my surprise to find out that someone else has the top the the search results on this because there is a discontinued web service by this name. findnot was a name I came up with on my own.
usage
C:\prj\findnot\findnot-1.0\win\t>findnot
findnot - see if string is NOT in a file and return appropriate errorlevel
usage: findnot [/?] [-[-]?] [-[-]h[elp]] [/h[elp]] [/v[ersion]] [-[-]v[ersion]]
findnot [-[-]i] searchstring filepath
/? or -? or --? or -h or -help or -h or /help or no arguments gives this help.
-v or /v or -version or /version gives the version number and exits.
-i or --i or /i turns on case insensitivity.
Double-quotes can be inserted in strings if you put 3 of them together, e.g. """
.
Returns errorlevel 0 on success (not found) and 1 on failure (found).
Also returns 1:failure if file cannot be opened or there was a file error.
I suggest you surround the filename and the string with "double quotes" to preve
nt the shell from executing and splitting up your strings and paths as arguments
.
The file will be opened as a text file.
example: findnot "<div><br><br><br><a href=" "c:\documents and settings\joe\my d
ocuments\www\index.html"
example: find /home/www -exec findnot -i "<meta name="""description""" content="
{} ; -print
Copyright 2009 Jim Michaels. Under GPL3 License.
C:\prj\findnot\findnot-1.0\win\t>
boilerplate
gcc compiler note: -fpack-struct cannot be used with iostream or anything to do with libstdc++ (including locale which includes iostream) without getting lots of errors.
The dos version is compiled with DJ Delorie's djgpp (gcc for DOS). It can be obtained at DJDelorie.com/djgpp.
The windows version was compiled with Borland C++ 5.5 (free edition). It is available at article (may include patches), free compiler (requires regisration).
The GNU compiler set has the peculiar ability to glob filenames at the command line. this can be a nice or an unwanted feature. to get around it, aurround the * with double quotes "*". This includes DJGPP-generated and MinGW-generated code.
The windows version was also compiled with MinGW 5.1.4 which is a GNU compiler set for windows. it has the peculiarity that it requires any use of __int64 to #include <basestd.h>, and it also doesn't allow 64-bit constants in the microsoft/borland style of appending i64 to the number. it requires you to use the gcc LL instead, however, printf does use %I64d rather than the normal gcc %lld. If you use %lld, your program will crash and do the DrWatson error report thing.
PHP is a programming language used for web page development and for applications and is available at http://php.net
ArgoUML is a UML diagramming tool used for designing programs and is available at http://argouml.tigris.org
Copyright 2009 Jim Michaels
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.