Data prep for using NodeXL

Dec 22, 2009 at 11:37 PM

Hi there,

Happy to have found NodeXL and dusting off my old SNA texts and journal articles to refresh myself with the concepts embedded within.

I'm hoping someone has cracked this nut before - not so much a NodeXL question, but a data prep question. I figure the approach would be useful to others working with the tool.

My example data has teams and players. Player 1 belongs to Team A. I've got 2 columns of Team/Player matches.

That's great if I'm doing a bi-modal graph. But I'd like a Player 1, Player 2 graph. 

So is there a quick Perl script or Excel Macro that can traverse 2 column data and make all the matches? Turning...

Player 1, Team A

Player 2, Team A

Player 3, Team A

Player 4, Team A


Player 1, Player 2

Player 1, Player 3

Player 1, Player 4

Player 2, Player 3

Player 2, Player 4

Player 3, Player 4

I've been sleuthing around looking at Perl:Graph and trying to get find the perfect Google query, but I simply can't find what I'm looking for (or the terms to describe the algorithm I just described in my example).

Much thanks in advance.




Dec 23, 2009 at 7:36 AM

Yeah.....nice question....I to have the same kind of problem......I did that but with lots of excel formulae and stuff.....not worth sharing :P

Dec 23, 2009 at 7:51 PM
I asked a developer that I know and they gave me some javascript to manipulate it. Works to sort an array where an array = 1 team only. 

Now I just need a little Perl utility to read the file in, loop through multiple arrays (teams) and then spit out the corresponding set of pairs.

Hope this is useful to see.



<script type="text/javascript"> var inputArray = ["Player 1", "Player 2", "Player 3", "Player 4"]; function bubbleSort(inputArray, start, rest) { for (var i = rest - 1; i >= start; i--) { for (var j = start; j <= i; j++) { if (i != j){ document.write(inputArray[i] + ', ' + inputArray[j] + "<br/>"); } } } return inputArray; } bubbleSort(inputArray , 0, inputArray.length); </script>