perl -F'\|' -ane' @F > 6 and $_{$k = join "\|", @F[2,3]} = $_ or $_{$k} .= $_; print map $_{$_}, sort keys %_ if eof ' infile