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
to the OP, if you have bash 4.0
#!/bin/bash # use associative array declare -A DUP file="myfile.txt" while read -r line do if [ -z ${DUP[$line]} ];then DUP[$line]=1 echo $line >temp fi done < "$file" mv temp "$file"