|
delete string in a text file leaving the first occurrence
Hi,
How can i delete the second and subsequent occurrence of a particular string from a file ?
eg) test.txt
cattle
bat
battle
mat
matter
cattle
cattle
my output file should be
cattle
bat
battle
mat
matter
I am new to unix and your advice is greatly appreciated.
Thanks in advance,
gops
|