Skip to content

Instantly share code, notes, and snippets.

@Nephos
Created March 20, 2017 18:00
Show Gist options
  • Save Nephos/9c464ca112423eca21598655b724556c to your computer and use it in GitHub Desktop.
Save Nephos/9c464ca112423eca21598655b724556c to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
data = File.read(ARGV[0])
data.gsub!(/(\d\.\d\d)(\d+)/, '\1')
data.gsub!(/(\d\d\.\d)(\d+)/, '\1')
data.gsub!(/[[:space:]]+/, ' ')
data = data.split("\n").map(&:strip).join
File.write(ARGV[1], data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment