Powershell: Reading txt-file, change rows to columns, save txt file : I have a txt files (semicolon separated) containing over 3 Million records where columns 1 to 4 have some general information. Columns 5 and 6 have detailed information. There can be up to 4 different detailed information for the same general information in columns 1 to 4.  

My sample input:  

> Server;Owner;Company;Username;Property;Value  
Srv1;Dave;Sandbox;kwus91;Memory;4GB  
Srv1;Dave;Sandbox;kwus91;Processes;135  
Srv1;Dave;Sandbox;kwus91;Storage;120GB  
Srv1;Dave;Sandbox;kwus91;Variant;16  
Srv2;Pete;GWZ;aiwq71;Memory;8GB  
Srv2;Pete;GWZ;aiwq71Processes;234  
Srv3;Micael;P12;mxuq01;Memory;16GB  
Srv3;Micael;P12;mxuq01;Processes;239  
Srv3;Micael;P12;mxuq01;Storage;160GB  
Srv4;Stefan;MTC;spq61ep;Storage;120GB 
  
Desired Output:
> Sever;Owner;Company;Username;Memory;Processes;Storage;Variant  
Srv1;Dave;Sandbox;kwus91;4GB;135;120GB;16  
Srv2;Pete;GWZ;aiwq71;8GB;234;;  
Srv3;Micael;P12;mxuq01;16GB;239;160GB;  
Srv4;Stefan;MTC;spq61ep;;;120GB;  
  
If a values doesn't exist for general information (Columns 1-4) it has to stay blank.  
I found [this one][1] but have troubles with the code. It's only working with comma separated values (CSV and TXT) but not with my semicolon separated files. And I read that this kind of solution is not the most efficient in my case with over 3 Million records.  

My current code (The same as in link, because I have almost no idea how it works):  

    $a = Import-csv .\table1.txt  
    $a | FT -AutoSize
    $Duration = Measure-Command {
        $b = @()
        foreach ($Property in $a.Property | Select -Unique) {
            $Props = [ordered]@{ Property = $Property }
            foreach ($Server in $a.Server | Select -Unique){ 
                $Value = ($a.where({ $_.Server -eq $Server -and 
                            $_.Property -eq $Property })).Value
                $Props += @{ $Server = $Value }
            }
            $b += New-Object -TypeName PSObject -Property $Props
        }
    }
    
    Write-Host "Finished transposing " -ForegroundColor Green -NoNewline
    Write-Host "$(($a | Get-Member -MemberType Properties).count)/$($a.Count)" -ForegroundColor Yellow -NoNewline
    Write-Host " columns/rows into " -ForegroundColor Green -NoNewline
    Write-Host "$(($b | Get-Member -MemberType Properties).count)/$($b.Count)" -ForegroundColor Yellow -NoNewline
    Write-Host " columns/rows in " -ForegroundColor Green -NoNewline
    Write-Host $Duration.Milliseconds -ForegroundColor Yellow -NoNewline
    Write-Host " Milliseconds" -ForegroundColor Green 
    
    $b | FT -AutoSize
    $b | Out-GridView
    $b | Export-Csv .\table2.txt -NoTypeInformation 

Summary:  
Reading in the txt-file with semicolon separated records  
Transpose the "table" with unique values in columns 1-4 and the detailed information in columns and their values in their rows  
Save transposed table into a new txt-file with semicolon separator.  

I'm running Win7 64bit with Powershell 4.0.  
Any ideas?  

Thanks in forward.
  [1]: https://gallery.technet.microsoft.com/scriptcenter/Powershell-Script-to-7c8368be#content