Start-Transcript -Path result.csv $oc = Import-Csv oldcats.csv $nc = Import-Csv newcats.csv #$doc=@{} $dnc=@{} $dncs=@{} $found=@{} #foreach($a in $oc){ # $doc.Add($a.PrimaCatTypeName.ToLower()) #} #approaching :D #recipe_type_id,recipe_category_id,recipe_type_description foreach($a in $nc){ $k=$a.recipe_type_description.ToLower() $v="$($a.recipe_type_id),$($a.recipe_category_id), $($a.recipe_type_description)" if (-not $dnc.containsKey($k)){ $dnc.Add($k,$v ) } if (-not $dncs.containsKey($k+"s")){ $dncs.Add($k+"s",$v ) } } #printing oldcat results foreach($a in $oc){ $k=$a.PrimaCatTypeName.ToLower() $head="$($a.PrimaCatTypeId), `"$($a.PrimaCatTypeName)`"," if ($dnc.containsKey($k)){ Write-Host "$head $($dnc[$k])" ; $found.Add($k,$k) } elseif ($dncs.containsKey($k)){ Write-Host "$head $($dncs[$k])" ; $found.Add($k,$k) } else { Write-Host $head } } #printing new oldcat Write-Host ":::New cats not found:::" foreach($a in $nc){ $k=$a.recipe_type_description.ToLower() if (-not $found.containsKey($k) -and -not $found.containsKey($k+"s") ){ $v="$($a.recipe_type_id),$($a.recipe_category_id), `"$($a.recipe_type_description)`"" Write-Host $v } } Stop-Transcript
Wednesday
powershell csv
Subscribe to:
Post Comments (Atom)
test smtp server with powershell
Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...
-
Here is instruction how to make blinking text in rainmeter: 1.right click and select " Edit skin " 2.add following code to temp...
-
Error:The element 'Schedule' has invalid child element 'RecurrenceRule'. List of possible elements expected: 'Occurring...
-
If you use Visual Studio to open a Web project that was developed for the .NET Framework 2.0, the .NET Framework 3.0, or the .NET Framework...
No comments:
Post a Comment