I'm wondering what the fastest way is to remove a specific line from a potentially large file, if it exists.
So for example I want the following line
abc
to be removed from the file
yxz
srtabc
abc
efg
becoming
yxz
srtabc
efg
Also, I want to add a line to the file, if it doesn't already exist.
The order of the file doesn't matter, and can be sorted if it provide a performance boost to the search.
Performance has never been my strong point, so I'm having a little trouble determining the best path to go down here.