in reply to Re: identifying null fields in bar delimited records
in thread identifying null fields in bar delimited records

I ended up doing this in awk; it could probably be translated to perl by someone smarter than me. For some reason the filename is printed AFTER the results instead of before as I would have expected, but otherwise this seems to work.
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"; }