Skip to content

Instantly share code, notes, and snippets.

@ebot
Created March 29, 2011 18:37
Show Gist options
  • Save ebot/892960 to your computer and use it in GitHub Desktop.
Save ebot/892960 to your computer and use it in GitHub Desktop.
Fix Patient Num
#!/usr/bin/env ruby -wKU
input = File.new 'input.txt'
output = File.new 'output.txt', 'w'
input.each_line do |line|
account = line.split '-'
puts " #{"%011d" % account[0]}#{account[1]}"
output << " #{"%011d" % account[0]}#{account[1]}"
end
input.close
output.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment