I need to count the lines with Powershell which are equal in a text file. Also I want to output the lines which appears two or more times just once with the count of occurrences
Example:
My text file:
WD WD3001BKHG-02D22,279.46 GB,SAS,u0
WD WD3001BKHG-02D22,279.46 GB,SAS,u0
SEAGATE ST300MM0026,279.39 GB,SAS,u1
SEAGATE ST9300603SS,279.39 GB,SAS,u1
I want to get the following output with the count of this line:
WD WD3001BKHG-02D22,279.46 GB,SAS,u0,2
SEAGATE ST300MM0026,279.39 GB,SAS,u1,1
SEAGATE ST9300603SS,279.39 GB,SAS,u1,1