hello Bruce, > The first key of each second level is missing, which differs from your sample > output above. > Have I corrupted your Awk code, or have I misunderstood something, or what?
you just spotted a bug: the first subkey *is* indeed required. actually fixing the bug makes the awk version even shorter. fix () { awk -F, '{print $1" "$2}' | sort -u | awk -F" " ' seen != $1 { seen = $1; print $1 } { print "\t"$2 } ' } regards marc