Skip to content

Instantly share code, notes, and snippets.

@ebot
Created May 15, 2012 17:15
Show Gist options
  • Save ebot/2703400 to your computer and use it in GitHub Desktop.
Save ebot/2703400 to your computer and use it in GitHub Desktop.
Splits unmatched accounts into an additions file for the mainframe.
#!/usr/bin/env ruby -wKU
input = File.new 'accounts.txt', 'r'
output = File.new 'additions.txt', 'w'
input.each_line do |line|
line = line.chomp.strip
enc = line.split '-'
output << " #{'%011d' % enc[0]}#{enc[1]}\n" unless line.nil?
end
input.close
output.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment