When I do cross product of records in file.txt > file2.txt using command :
join file1.txt{,} -j999 > file2.txt
I get each record in file1.txt with all the records in file1.txt such as:
sample dataset
r1
r2
r3
I get
r1 r1
r1 r2
r1 r3
r2 r1
r2 r2
r2 r3
r3 r1
r3 r2
r3 r3
I dont want r1 r1, r2 r2, records and so on...
If its possible right while doing cross product, how do I get expected results? if not, How do I remove the records after processing join file1.txt{,} -j 999
I tried this with another awk command :
if($i!=$(i+12)){print $0;} and
if($1!=$13){print $0;}
Because I have serial number of each record 1,2,3,... I have file2.txt as :
c1 c13 --> column 1 and column 13
1 1
1 2
1 3
1 4
2 1
2 2
2 3
2 4
3 1
3 2
3 3
3 4
I simply compare serial numbers and if they are not equal print those records. but I get undesired results, such as:
1 2
1 3
1 4
2 3
2 4
3 4
You can see it skips all the records before $1!=$13. so there are rows missing like:
2 1
3 1
3 2
it should only skip the records that are in pattern r1 r1, r2 r2,...
Update
1st and 13th col is serial numbers.