Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Friday, November 19, 2004

Ruby script for turning an Oracle .tab file into something diffable


output = []
table = ""
while line = STDIN.gets
line.chomp!
if line =~ "CREATE TABLE (.*)" then
table = $1
end
if line =~ "^ [,(].*" then
output << table + "." + line[2..-1]
end
end
puts output.sort

0 Comments:

Post a Comment

<< Home