Advertisement
Guest User

E0x

a guest
Jul 11th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. orig = open('ES10_SGC_20110531.TXT', 'r')
  2. orig1 = open('ES10_SGC_20110531.TXT', 'r')
  3. targ = open('ES10_SGC_20110531.SAV', 'w')
  4.  
  5. def splitline(line, z):
  6.     if z == 0:
  7.        pass
  8.  
  9.     fields = line.split('|')
  10.     nlist = []
  11.     for field in fields:
  12.         nlist.append(field)
  13.  
  14.     return nlist[z]
  15.  
  16. for line1 in orig:
  17.     targ.write(line1)
  18.     value1 = splitline(line1, 1)
  19. #    print value1, 'value1'
  20.     for line2 in orig1:
  21.         value2 = splitline(line2, 2)
  22.         if value1 == value2:
  23. #            print value2, 'value2'
  24.             targ.write(line2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement