Re: Grep Text File for Lines Containing 1 or 2 Words
From: John W. Krahn (someone_at_example.com)
Date: 01/26/05
- Next message: PerlFAQ Server: "FAQ 6.3 How can I pull out lines between two patterns that are themselves on different lines?"
- Previous message: Ala Qumsieh: "Re: 20050126 find replace strings in file"
- In reply to: Buck Turgidson: "Grep Text File for Lines Containing 1 or 2 Words"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: PerlFAQ Server: "FAQ 6.3 How can I pull out lines between two patterns that are themselves on different lines?"
- Previous message: Ala Qumsieh: "Re: 20050126 find replace strings in file"
- In reply to: Buck Turgidson: "Grep Text File for Lines Containing 1 or 2 Words"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|