On Sat, 4 Jul 2015, David Fleck wrote:

> Try removing the backslashes:
> egrep -cE "^P[[:digit:]]{5}"
> That works for me.

David,

   That was one of the first flavors I tried; still doesn't work:

[rshepard@salmo ~]$ egrep -cE "^P[[:digit:]]{5}" hrwq.dat 
0

   After a number of futile attempts (and re-readings of the grep man page) I
got my answer the old-fashioned way: counting.

   The file is 851 lines long. There are 212 comment lines at the top, plus 1
header line. That leaves 638 data lines, of which half begin with Pnnnnn and
the other half begin with Rnnnnn. So, there are 319 lines beginning with
Pnnnnn in the file. Good ol' Python on the command line.

Happy 4th,

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

Reply via email to