I have a csv-File which i import into PowerShell.
[ID];[GroupID];[en];[de]
001;001;on;an
002;001;off;aus
I tried to sort by the certain header names ([en], [de]) and display all values below.
What i tried:
$FileImport = Import-Csv D:\test -Delimeter ";"
$FileImport | foreach {
$_.psobject.properties | foreach {
"{0}`n {1}" -f $_.name, $_.value
}
}
Write-Host $FileImport
Result is the following:
[ID]
001
[GroupID]
001
[en]
on
[de]
an
[ID]
002
[GroupID]
001
[en]
off
[de]
aus
What i want to have is this result:
[en]
001 001 on
002 001 off
[de]
001 001 an
002 001 aus
Is there a possibility to get this as a result?
PS: This is only a testfile the original file has round about 30000 rows and 30 languages (Columns)
I have to do this in PowerShell.
Any help would be helpful since im rather new to Powerscript.
Thank you.