I need to find the duplicate values in a text file using power shell let's say if the file content is
Apple
Orange
Banana
Orange
Orange
Desired output should be
Orange
Orange
I need to find the duplicate values in a text file using power shell let's say if the file content is
Apple
Orange
Banana
Orange
Orange
Desired output should be
Orange
Orange
You can also use the Group-Object cmdlet to see if any lines occur more than once:
e.g.
Used the Commands mentioned below and it worked.
or to print the text and the count use the following command