in reply to Re: identifying null fields in bar delimited records
in thread identifying null fields in bar delimited records
BEGIN{FS="\|";} { line= substr($0,0,length($0)-1); #peel trailing bar n=split($0,a); for (i=0;i<n;i++){ line=line a[i]; if(a[i] ==""){nulls[i]++}; } } END{ print FILENAME; for (i in nulls) print "\t field " i": " nulls[i] " nulls"; }
|
|---|