I’m powershell newbie and I have a .csv file like this:
Group1; User_A
Group1; User_B
Group2; User_A
Group2; User_D
Group2; User_C
How can I replace items with whitespace from the first column so that I get only the first item in group:
Group1; User_A
; User_B
Group2; User_A
; User_D
; User_C
I tried something like
$header = "Group", "User"
$adg = Import-Csv "C:\temp\users.csv" -Header $header -Delimiter ";"
$adg | ForEach-Object {$_ -replace "Group1", ""}
but I don’t have a clue how to proceed
How about something like this:
Output:
Update:
Just for fun here is a version that outputs something that looks exactly like your example:
Output: