Skip to content

Instantly share code, notes, and snippets.

@kainage
Last active December 18, 2015 23:39
Show Gist options
  • Save kainage/5863593 to your computer and use it in GitHub Desktop.
Save kainage/5863593 to your computer and use it in GitHub Desktop.
Titleize each line in a file
#!/usr/bin/env ruby
require 'active_support'
require 'active_support/inflector'
file = File.open('output.txt', 'w+')
ARGF.readlines.each do |line|
file << line.titleize
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment