Skip to content

Instantly share code, notes, and snippets.

@jwarchol
Created January 6, 2010 18:03
Show Gist options
  • Save jwarchol/270478 to your computer and use it in GitHub Desktop.
Save jwarchol/270478 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
input = ARGF.read
# Split on commas
values = input.split(/\s*,\s*/)
# Unique
values.uniq!
# Print as comma delimited
puts values.join(", ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment