Created
May 15, 2012 17:15
-
-
Save ebot/2703400 to your computer and use it in GitHub Desktop.
Splits unmatched accounts into an additions file for the mainframe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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