grep: a pedestrian, very fast grep utility
by us
16 Jan 2006
(Updated 04 Apr 2006)
Code covered by BSD License
a unix-like, very fast grep utility to find strings(s) in files of any type
Download Now
|
Watch this File
|
| File Information |
| Description |
a fast grep utility, which finds string pattern(s) in all or selected files of any type in a folder and its subfolders (if the recursion flag -r is set).
file access and string matching are optimized by low-level i/o and string routines.
the recursion algorithm (-r) does not use ML's genpath.
the syntax and options as well as the output closely follow its unix/linux sibling.
string patterns may be defined as regular expressions.
many options allow to fine tune the GREP engine including an extensive set of inclusion/exclusion flags for folders, files, and full paths, which implement a regular expression based wildcard search.
clicking on an underlined text item will open the file at the matching line.
several help levels are implemented
1) quick overview
> grep
> help grep
sparse information about syntax and option flags (see screenshot)
2) extended help
> grep -p
syntax/peculiarities of pattern/file arguments
> grep -e
several examples (see also grepdemo.m)
> grep -f
for programmers: explanation of the second output argument
see the accompanying published M file for instructions and a few typical examples. |
| MATLAB release |
MATLAB 7.1.0 (R14SP3)
|
| Other requirements |
good spirits |
| Zip File Content |
|
| HTML Files |
html/grepdemo.html
|
| Other Files |
grepdemo.m, grep.txt, grep.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (10) |
| 17 Jan 2006 |
John D'Errico
|
|
|
| 19 Jan 2006 |
John D'Errico
|
|
|
| 25 Jan 2006 |
John D'Errico
|
|
|
| 16 Mar 2006 |
Malcolm Wood
|
|
|
| 04 Apr 2006 |
Kevin Hung
|
|
|
| 16 Aug 2006 |
Alex Chung
|
|
|
| 21 Sep 2006 |
Jay Dermody
|
|
|
| 08 Nov 2007 |
Abel Brown
|
|
|
| 05 Jul 2009 |
Yair Altman
|
|
|
| 30 Sep 2009 |
almog shalom
|
|
|
| Updates |
| 18 Jan 2006 |
added a few examples |
| 19 Jan 2006 |
thanks to john d'errico, summary page now shows the correct ML version (14.3+). |
| 25 Jan 2006 |
help sections upgraded (request dr john d'errico); e-option now can use string and cell arguments; version tag 25-Jan-2006 14:58:48 |
| 10 Feb 2006 |
many users requested a change of the name from FGREP to GREP since latter can be type much faster; minor changes in the help and example sections |
| 20 Mar 2006 |
added malcolm wood's suggestion: the user now can click on an underlined list item in the command window to open the file and jump to the line number; version tag 16-Mar-2006 20:22:12 |
| 21 Mar 2006 |
unfortunately, not all files were updated correctly! version tag 21-Mar-2006 13:21:45 |
| 30 Mar 2006 |
clarification on use of -e option arguments; version tag 30-Mar-2006 15:24:10 |
| 03 Apr 2006 |
added an extensive set of inclusion/exclusion options for folders, file names, and combined full paths, which implement a regular expression based wildcard search engine (request by user kevin hung); version tag 03-Apr-2006 00:15:40 |
| 04 Apr 2006 |
now checks in unix-type subfolders that begin with a ., eg, .foo (requested by user kevin hung); version tag 04-Apr-2006 00:31:57 |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com