COMPARING COLUMNS IN A TEXT FILE

Hi, Good day.

I currently have this data called database.txt and I would like to check if there are no similar values (all unique) on an entire row considering the whole column data is unique. the data is as follows

cL1 cL2 cL3 cL4
a12 c13 b13 c15
b11 a15 c19 b11
c15 c17 b13 f14

with the first line only as basis for column numbers

I am assuming first the logic in comparing all column to every single column in the data.
I need to do is for example I will compare cL1 (column 1) and cL2 (column 2) for similar row values.
Selecting the two rows I get
a12 c13
b11 a15
c15 c17
Column 1 & 2 are unique to each other
Selecting 2nd and 3rd:
c13 b13
a15 c19
c17 b13
Column 2 & 3 are NOT unique to each other. Reason is that on 3rd column, there are two "b13".
Selecting 3rd & 4th:
b13 c15
c19 b11
b13 f14
Column 3 & 4 are NOT unique to each other. Reason is that on 3rd column, there are two "b13".
Selecting 1st and 3rd... Check again if there are no repetition by column and row
Select 1st and 4th... Check again
Select 2nd and 4th... Check again

if all columns are compared to each other and just one comparison is not unique, then the file is not unique already.

Can you suggest other ways to confirm if my theory is right? And if you have similar script, i would be thankful if you can share it because I'm new here and I have only slept 2 hrs last night banging my head for solutions...

Column, row, sheesh!

Maybe it s a problem because you are not being relational, you are really examining 4 derived one column tables from this data. Sort each column up and compare them, using 'comm' or 'join'. The comm command expects unique data, so run it through 'sort -u'. Check a column against itself with 'sort|uniq -d'. Once you have the problem values and their column, you can use them to find the original rows.