Say I have a file like:
apple pear lemon lemon pear orange lemon
How do I make it so that I only keep the unique lines, so I get:
Run PowerShell from the command prompt.
Assuming the items are in a file call fruits.txt, the following will put the unique lines in uniques.txt:
fruits.txt
uniques.txt
type fruits.txt | Sort-Object -unique | Out-File uniques.txt