MS Windows -|- Back to Projects -|- Zip File Listing -|- Home -|
in-file links: help downloads pcre end
Finding a block of text, in a set of file, recursively into folders, is a common tool, called grep in unix/linux ... this is just another, personal tool ... it is called fa4 - 'fa' = Find All, and 4, was the migration from 16-bits to a WIN32 version.
2011/11/07: Minor addition to accept a 'directory' to search in all files in that
Update: Feb 04, 2010: Added latest version dated 29 Dec, 2009
Update: May 31, 2008: Checked out a unix grep source, and compile it in WIN32. Check it out here ...
Here is the 'help' output of this version -
Informatique Rouge *** FAST FIND ALL UTILITY *** V4.0.68 - 2011 November 7 Purpose: To locate specific text in a file or group of files. Usage: FA4 Arg1 Arg2 [-Switches] Where: Arg1 = "Find Text" or @FindItems.txt file. Arg2 = [[D:\]Path\]File(s) or @FileList. The @Input files are interpreted as a set of line delimited items. Switches: Each preceeded by '/' or '-' , space separated, case ignored. -8 = Ouput file name in DOS format. -B[-][n:n] = [-] Ignore binary, else force binary file find. [Back:Forward] (def=40:40) -c = cASE tOGGLE - Be case SenSiTive. -D[NLO[DS]] = Directory List. (N=Normal, L=list output, O=order[D=date(def)|S=size]) -Ennnnn = Find WIN32 Error or closest.(Try ALL). -F="text" = Find multiple items. (-F:1 = all in one file -F:2 = all in one line) -FR=regex = Find using a pcre (Perl Compatible Regular Expression). -I:"text" = Inhibit finds with this text. (-I+ for C/C++ comments) -L[W][nn|F] = Output Additional [Wnn=wrap at (def=90)][nn=lines|F=Complete function]. -LL[nn[:nn] = Limit line output - default = 80, nn:nn = left:right, just nn = left=right=nn/2. -M = Process as a MAKE file. Same as -F:M. 2 expands $(mac). -N = Line numbering on finds. -OOutFile = Add all output to a file. -P = Ignore Parity for compare. (8th bit stripped). -R = Recursive into sub directories. -UInFile = Use InFile as list of files to search. -Vn = Verbosity level and type. (Def=V2). -W = Only whole words (Includes like :WHOLE_. -W2 for spaces). -Xname = Exclude file from search, or as @InFile or ';' separated list. -X:[name|:] = Exclude directory from search. ::=FrontPage, :::=CVS/.svn directories. Notes: Errorlevel gives the find count. -IC inhibit finds in C/C++ comments. Output: V0=None, V1=Files, V2=Finds & Files(def), up to V9=ALL ON. Note -V3 adds date and time after find file, and -V4 add a list at end. "\ntext" to find text ONLY at the beginning of the line ... Compiled using MSVC v.1400 on Nov 5 2011 at 10:42:23, run by Geoff McLane, on DELL01 machine. Happy searching...
As stated, there are 'many' pieces of software to do this. A WIN32 port of the unix/linux tools can be found at http://unxutils.sourceforge.net/ ... And as mentioned above, I have now built my own WIN32 port of grep, which I called 'grepw32' ... but my FA4 is at least as fast, and has some 'different' features ;=))
The beauty of having your OWN is that anytime you want some very special feature, you can just load the source into MSVC, and begin modifying it ... If anyone adds there own neat feature I would certainly appreciate a copy of the modified source, so I too can benefit ;=))
One of the 'special' features I use most is the -x:: to inhibit the _vti_cnf, etc hidden folders created and used by FrontPage; one that is almost never used now is -8 to return the old DOS 8.3 file name, but it had a good purpose at the time, but less important now ...
Add in the PCRE (http://www.pcre.org/) library, so I could use 'regular expressions' in the search, but this has not been exercised very much. Another highly specialized switch is -D to process a 'directory' file, that is a file produced for simple redirection of the > DIR command, and give the directory name, as well as the file name found ...
Below is the SOURCE and a WIN32 RUNTIME, in zip format, for download ....
fa4-28.zip: Full source, including MSVC build files.
fa4e28.zip: Win32 binary executable
Older Source and Runtime Downloads for WIN32