Hi guys,
I got a file having this kind of records:
000000000111GOOGLE 5428MG45525RC
000000000122MICROSOFT 8565MG85454RE
000000000044APPLE 5814KL484545RC
I want to keep only the records that have 'MG' in position 34 and NOT ('RE' or 'RD') in position 41
What should I add to this code?
#!/usr/bin/python
infile = 'DATA'
input = open(infile, 'r').readlines()
outfile = 'OUTPUT'
output = open(outfile, 'w')
for line in input:
linelist = line.split()
if ???? :
output.write(line)
break