Glanced over & saw "check" instead of "uncheck" - sorry.
I am using all-numeric data, tab-delimited, as input to the following code from top of p.77; is there any reason that this script should not run as typed?:
NR == 1 {
nfld = NF
for (i=1; i <=NF; i++)
type = isnum($i)
}
{ if (NF != nfld)
printf("line $d has %d fields instead of %d\n",
NR, NF, nfld)
for (i=1; i <= NF; i ++)
if (isnum($i) !=type)
printf("field %d in line %d differs from line 1\n",
i, NR)
}
function isnum
{ return n ~ /^[+-]?[0-9]+$/ }
I am using all-numeric data, tab-delimited, as input to the following code from top of p.77; is there any reason that this script should not run as typed?:
NR == 1 {
nfld = NF
for (i=1; i <=NF; i++)
type = isnum($i)
}
{ if (NF != nfld)
printf("line $d has %d fields instead of %d\n",
NR, NF, nfld)
for (i=1; i <= NF; i ++)
if (isnum($i) !=type)
printf("field %d in line %d differs from line 1\n",
i, NR)
}
function isnum