Nancy Street

grepf

Click to see the Site Map
HomeInfoMusicGalleryPetsGeoHobbiesGeo
Site MapWhat's NewRecent ChangesContactsServer StatisticsSite Information Home « Computers « grepf

grepf is a command line utility written in C# under the .NET 1.1 Framework that searches for text in files using regular expressions and then copies or moves the files containing matches. This utility was developed out of simple need, as I found I was frequently searching for strings in files and wanting to move the matching files to other directories. This most common us of this function is for filtering spam as it arrives at the Nancy Street mail server.

Here is the help display from grepf when no parameters are entered:

grepf (Version 1.5.0.0)
Finds regex patterns in files and copies or moves the files
when matches are found or not found.
SYNTAX: grepf inmask [@]expr [-mmatchdir] [-nnomatchdir] [-llogfile] [-move]
inmask ....... Input file mask to scan.
expr ......... A single grep expression or a @file specifying the name of a
file containing multiple expressions, one per line.
matchdir ..... Output directory for "match" files.
nomatchdir ... Output directory for "nomatch" files.
logfile ...... Output processing messages log file.
-move ........ Move instead of copy to -m -n destinations.
-t ........... Timestamp prefix on display lines.
-v ........... Verbose mode.
-fnnn ........ Search only the the first nnn lines.

A description of the regular expression syntax can be found at MSDN Introduction To Regular Expressions.

grepf Project - (6KB) ZIP of the Visual Studio .NET 2003 Project with source code

grepf Executable - (5KB) ZIP of the EXE file only

Back to: Computers & Software Main Page


Contact Information | PGP Keys | Site Map | What's New | Visitor Book
Last Updated: 06-Aug-2007 21:12
Copyright © 1999-2007 Orthogonal Programming