I have 10 text files containing 1000's of rows.
Example: First File:
V1 V2
1 2
2 3
10 20
1 4
.....
Second file:
V1 V2
1 2
8 10
.....
What I want is a final file which will contain 12 columns. The first two columns representing the relationship and the next 10 columns telling about different files ( represented by 1 if that pair is present and 0 if not present ) For example:
Final File:
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12
1 2 1 1 0 0 1 0 1 1 0 1
2 3 1 0 1 1 0 0 0 1 1 0
Now, what I did was sort every file so that all the pairs with 1 as their first number appears on top followed by other numbers, i.e.
For a particular file, I did so that,
V1 V2
1 2
1 3
1 10
1 5
2 10
2 15
.......
Then, I tried using the merge command, however, I know it's not the right one. I am not able to think of other method to do it.