views:

18

answers:

1

can somebody help me, how can I filter my file, inside the file I have rows with 3, 4, 5 elements, I want print using echo only these which have 5 elements, thanks in advance (I'm talkin about scripts)

A: 

cat $file | awk '(NF==5) { print $0}'

Charles Stewart
Charles Stewart: sorry, but is it possible to find another way? I'm working with c-shell
lego69
@lego69: That *is* csh: two Unix calls, one pipeline, one variable substitution. What's the problem?
Charles Stewart
http://partmaps.org/era/unix/award.html#uucaletter ;-)
Johnsyweb
@Johnsyweb: I love cats. Feel lucky I spared you twins: cat $file | cat | awk ...
Charles Stewart