Ruby + 5 mins =
table = <<-TABLE
...paste table here...
TABLE
rows = (table.split "\n").collect { |line| line.split("|") }
puts (0.. rows[1].length).each { |col| puts "|#{rows.collect{ |row| row[col] }.join("|")}|" }
Ahhhh.. That could have been painful.
I love being a programmer. How do people that don't code handle this sort of problem?
1 comment:
You assume that all programmers would be capable of creating a solution like yours.
Do you read the Daily WTF?
Post a Comment