Created
November 12, 2010 15:48
-
-
Save eightbitraptor/674247 to your computer and use it in GitHub Desktop.
select id from blah, and get the output in a form suitable for copying and pasting to other sql statements/arrays etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
output = "" | |
ARGF.each do |line| | |
next if line.match(/^\+/) | |
if line.match(/\|\s+(\S+)/) | |
output << ($1 + ",") | |
end | |
end | |
STDOUT.puts output.chomp(',') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment