Frage

I have two Csv's

Csv1 CI Name, region xyz,London abc,Cairo lmn,Brisbane qrs,Sao paulo

Csv2 DeviceName, IPAddress abc, 10.0.0.1 xyz, 10.0.0.2 ijk, 10.0.0.3 lmn, 10.0.0.4

Desired output CI Name, Region, IPAddress abc, Cairo, 10.0.0.1 xyz, London, 10.0.0.2 lmn, Brisbane, 10.0.0.4 ijk, ,10.0.0.3 qrs, Sao Paulo,

As you can see the property name CI Name and DeviceName is different of Csv 1 and csv 2 although there are common values

Other merge functions that I checked here have the same property name, for example CI Name or DeviceName is found on both CSVs How would i do this? please help

War es hilfreich?

Lösung

A far as I understand you are looking for a way to join these two CSV tables on 'CI Name' = 'DeviceName' .

You can apply the answer of PowerShell: Combine two tables.

The only you have to do is to change the way you import one of the CSV file :

Import-Csv 'Csv1.csv' -Header "DeviceName", "region" "xyz", "London abc", "Cairo lmn", "Brisbane qrs", "Sao Paulo"

Perhaps you have to remove the previous heaser first.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top