if __name__ == "__main__": pass fileUtil = FileUtil() content = fileUtil.openFile(phoneSrc) # print content; content = content.replace("\r", " ").replace("\t", " ").replace("\n", " ") # print content; items = content.split(" ") items = [item for item in items if item != ""] output = "" index = 1 for i in range(len(items)): if i % 2 == 1: print index index += 1 location = getLocation(items[i]) itemstr = items[i] + " " + location + "\n" output += itemstr fileUtil.cleanAndWrite(outputfile, output) print itemstr print "DONE....." print output