http://www.linuxquestions.org – Hi to all my data looks like this Code pedigree A B C D E F A B C D E F X X1 -/- -/- -/- C/C A/A -/- eq eq eq ne eq eq Y Y1 C/C C/C A/A A/A A/A A/A 1 X1/Y1 C/C C/C A/A A/A Z/Z A/A 2 X1/Y1 C/C -/- A/A A/A A/A A/A 3 X1/Y1 -/- C/C A/A A/A A/A A/A 4 X1/Y1 Z/Z C/C A/A A/A A/A A/A 5 X1/Y1 C/C C/C A/A A/A A/A A/A First I would like to count total number of different coulmns within a pair of X1 and Y1 across from cloumn A to F, If (HowTos)