Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 226498

Re: Help required to combine the output in CSV

$
0
0

Try with the following conversion script

&{foreach($row in (Import-Csv C:\Aravind\VM.csv -UseCulture)){

    $first = $true

    if($row."VM name" -match ','){

        ($row."VM name").Split(',') | %{

            New-Object PSObject -Property @{

                Properties = &{

                    if($first){

                        $row.Properties

                        $first = $false

                    }}

                "VM name" = $_

            }

        }

    }

    else{$row}

}} | Export-Csv new-report.csv -NoTypeInformation -UseCulture


Viewing all articles
Browse latest Browse all 226498


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>