Path: utzoo!news-server.csri.toronto.edu!rutgers!cbmvax!uunet!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: extract -- field-oriented grep and expr Message-ID: <1991Mar14.063047.3015@convex.com> Date: 14 Mar 91 06:30:47 GMT References: <1991Mar11.231636.13429@mav.com> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 19 Nntp-Posting-Host: pixel.convex.com From the keyboard of roger@mav.com (Roger Droz): :Never underestimate the power of self-modifying code! Take a simple perl :three instruction perl loop, and add a user interface and you have the :following "database extraction" filter, ready to take its place along :side cut, paste, sort, and grep. : :The enclosed shar contains "extract", which effectively does an expr(1) :on one or more fields in a file, sending lines the meet the condition to :stdout. : :Example: : extract -t: 3n '>' 700 '&' 3n '<' '900' /etc/passwd : : Extract those lines from /etc/passwd with the 3rd colon-delimited : field (user-id) between 700 and 900. I truly hate to be the one to say this, but how is this better than awk? --tom