Ruby - 925
I'll get the ball rolling. Run as "ruby hammer.rb hammer.rb".
Golfed
def z x
l=x.unpack u='C*'
d=[]
(0..9).each do|i|d<<[].fill(48+i,0,80);end
d<<a=[].fill(32,0,80)
d<<a.dup
h=Hash.new
i=0;' abcdefghi'.unpack(u).each do|c|h[c-32]=[i,11];h[c]=[i,11,0];i+=1;end
i=0;' jklmnopqr'.unpack(u).each do|c|h[c-32]=[i,10];h[c]=[i,10,11];i+=1;end
i=0;' stuvwxyz'.unpack(u).each do|c|h[c-32]=[i,0];h[c]=[i,0,10];i+=1;end
h[47]=[1,0]
i=0;'0123456789-&'.unpack(u).each do|c|h[c]=[i];i+=1;end
i=0;' :#@\'="'.unpack(u).each do|c|h[c]=[i,8];i+=1;end
i=0;' [.<(+|'.unpack(u).each do|c|h[c]=[i,8,11];i+=1;end
i=0;' ]$*);^'.unpack(u).each do|c|h[c]=[i,8,10];i+=1;end
i=0;' \,%_>?'.unpack(u).each do|c|h[c]=[i,8,0];i+=1;end
h[32]=[]
i=0;l.slice(0,80).each do|c|h[c].each do|r|d[r][i]=215;end;i+=1;end
puts' %s'%('_'*81)
puts' /%-80s |'%l.pack(u)
puts' / %s |'%d[11].pack(u)
puts' / %s |'%d[10].pack(u)
(0..9).each do|i|puts'| %s |'%d[i].pack(u);end
puts'|%s|'%('_'*84)
end
ARGF.each do|l|z l.chop;end
Ungolfed
def punch029(line) # line is array of ASCII characters in ordinal (integer) form
chad=[]
(0..9).each do |i| chad<<[].fill(48+i,0,80) end
chad<<[].fill(32,0,80)
chad<<[].fill(32,0,80)
r10 = 10-10
r11 = 11-1
r12 = 12-1
# Reward "bad" input characters with all-row multi-punch.
# hash = Hash.new( [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] )
#
# OR
#
# Reward "bad" input characters by letting Ruby puke. (Jam the machine.)
hash = Hash.new
'0123456789-&'.unpack('C*').each_with_index do|c,i| hash[c]=[i] end
' ABCDEFGHI'.unpack('C*').each_with_index do|c,i| hash[c]=[i,r12] end
' JKLMNOPQR'.unpack('C*').each_with_index do|c,i| hash[c]=[i,r11] end
' /STUVWXYZ'.unpack('C*').each_with_index do|c,i| hash[c]=[i,r10] end
' :#@\'="'.unpack('C*').each_with_index do|c,i| hash[c]=[i,8] end
' [.<(+|'.unpack('C*').each_with_index do|c,i| hash[c]=[i,8,r12] end
' ]$*);^'.unpack('C*').each_with_index do|c,i| hash[c]=[i,8,r11] end
' \,%_>?'.unpack('C*').each_with_index do|c,i| hash[c]=[i,8,r10] end
' abcdefghi'.unpack('C*').each_with_index do|c,i| hash[c]=[i,r12,r10] end
' jklmnopqr'.unpack('C*').each_with_index do|c,i| hash[c]=[i,r11,r12] end
' stuvwxyz'.unpack('C*').each_with_index do|c,i| hash[c]=[i,r10,r11] end
hash[32] = [] # fix space
hole = 215
line.slice(0,80).each_with_index do |c, index|
hash[c].each do |row| chad[row][index] = hole end
end
puts ' %s' % ('_'*81)
puts ' /%-80s |' % line.pack('C*')
puts ' / %s |' % chad[11].pack('C*')
puts ' / %s |' % chad[10].pack('C*')
(0..9).each do |i|
puts '| %s |' % chad[i].pack('C*')
end
puts "|%s|" % ('_'*84)
end
# 1 2 3 4 5 6 7 8
#2345678901234567890123456789012345678901234567890123456789012345678901234567890
ARGF.each do |line|
punch029(line.chomp.unpack('C*'))
end