Re: Grep Text File for Lines Containing 1 or 2 Words

From: John W. Krahn (someone_at_example.com)
Date: 01/26/05


Date: Wed, 26 Jan 2005 22:54:39 GMT

Buck Turgidson wrote:
> Looking for help in writing a perl that will pull from a text file those
> lines containing one or two "words". I want to reject any line that
> contains more than 2 words (a sentence).
>
> Appreciate any help from text processing experts.

perl -ane'@F<3&&print' yourfile.txt

John

-- 
use Perl;
program
fulfillment


Relevant Pages