in reply to How can I read and print lines that has only one word from a file


Here is one way:     perl -nae 'print if @F == 1' file

And here is another:     awk 'NF == 1' file

--
John.

Replies are listed 'Best First'.
Re^2: How can I read and print lines that has only one word from a file
by Aristotle (Chancellor) on Jul 15, 2002 at 14:13 UTC
    ++! But don't forget to mention that perlrun is the place to look at when you hit a novice with such a solution. :-)

    Makeshifts last the longest.