On Mon, 23 Jul 2018, Tomas Kuchta wrote:

Do not use switch/case - just use NF==35 {print "I see 35 columns on this
line"}
... type of a code.

If you need more than that you can do something like this:
NF==35 && $2<5 {print "I see 35 columns on this line and column 2 is less
than 5"}

I guess that is what Russell was saying too.

Tomas,

  It turns out that the switch/case statement works when the whole thing is
enclosed in curly braces because it's all part of the action response. So it
would look like this:

{ switch (NF) {
  case 1:
    ...
  case 2:
    ...
  }
}

  But, using the number of fields as the pattern does make it easier to
read:

NF == 36 { print .... }

Thanks,

Rich
_______________________________________________
PLUG mailing list
PLUG@pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to