Skip to content

Instantly share code, notes, and snippets.

@hachy
Created September 25, 2013 09:06
Show Gist options
  • Save hachy/6697003 to your computer and use it in GitHub Desktop.
Save hachy/6697003 to your computer and use it in GitHub Desktop.
ruby space_squeeze.rb file1.txt > file2.txt
ARGF.each_line do |line|
puts line.gsub(/[ ]+/, ' ').rstrip
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment