in reply to Re: Column Comparison of a File in Perl
in thread Column Comparison of a File in Perl

Thanks a lot fopr the reply and sorry for bad explainations. Since, I have only two values i.e. 1 or 2 in both the columns, I would like to compare the values which are identical in the same position of the row but are different in position of the columns. for eg:
A id 12(F.C.) 12 (S.C.) 15(F.C.) 15(S.C.) 16(F.C.)16 (S.C.) M X1 1 2 2 2 2 2 M X2 2 1 1 1 1 1 M X3 1 2 2 2 2 2
It is the subset of the above data, where F.C. represents First Column and S.C. represents Second Column (included for being more descriptive). Here, we see that the second column of 12 is identical to first and second column of 15 and 16. Therefore, I would like to know the longest stretch of the two similar/identical columns. Similarly, I would like to do it for all the other columns. Remember: that I can't compare the first column of 12 with second column of 12.