in reply to how to convert two lists into adjacency matrix
Please have a look at How do I compose an effective node title? and at Markup in the Monastery.
Don't misuse <pre>-Tags here.
To your question: you're telling what you have as data source and what the desired result should look like.
But you don't show where you have your problems...
So, where's your problem hidden? What do you have problems with?
Are you looking for someone to write your code?
Update: You could do something like this (if you want to do it on your own):
- read data
- read data file and ignore header line
- chomp and split each line into two pieces
- create an entry in a hash-of-hash (HoH); $hash{id1}->{id2} = 1;
- store id2 in an array if not already in that array
- output:
- for each key in %hash print that key; check for every entry in your array if an entry in the HoH exists, if so, print 1, if not, print 0.
In Section
Seekers of Perl Wisdom