Hello,
So I have a table that looks like this:
A B
A C
B A
C A
C B
I want to delete the lines that the connection of two values are already in represented (so A----B is the equivalent connection as B----A). Basically I want my table to look like this.
A B
A C
B C
How can I do this in Ruby?
-Bobby
EDIT:
Here is my current code:
require 'rubygems'
f = File.new("uniquename.txt","w")
i = IO.readlines('bioportnetwork.txt').collect{|l| l.split.sort}.uniq
i.each do |z|
f.write(z + "\n")
end
I tried this code, but I think the IO.readlines did not read my columns correctly. Here is one part of my table.
9722,9754 8755
8755 9722,9754
9722,9754 7970,7971
7970,7971 9722,9754
How can I get it read correctly, then saved out correctly as a TSV file?
-Bobby