I\'m trying to use VIM to remove a duplicate line in an XML file I created. (I can\'t recreate the file because the ID numbers will change.)
The file looks something
with python to remove all repeated lines:
#!/usr/bin/env python
import sys
def remove_identical(filein, fileout) :
lines = list()
for line in open(filein, 'r').readlines() :
if line not in lines : lines.append(line)
fout = open(fileout, 'w')
fout.write(''.join(lines))
fout.close()
remove_identical(sys.argv[1], sys.argv[2])