Match and Update Csv

Welcome Forums General PowerShell Q&A Match and Update Csv

This topic contains 1 reply, has 1 voice, and was last updated by

3 years, 10 months ago.

  • Author
  • #24165

    Points: 0
    Rank: Member


    I am working with a Csv master list. After gathering data and exporting it to a "working set "csv list Id like to update my master list by matching computer names and update my 'online' field

    any help would d be greatly appreciated.

    heres what I have so far

    $master = "C:\MasterList.csv"
    $working = "C:\workingset.csv"
    $masterlist = ipcsv $master
    $workingset = ipcsv $working
     $Output = foreach ($m in $masterlist) {
        foreach ($w in $workingset) {
            if ($m.computername -like "*$($w.computername)*") { $ = $ }
    $Output | Export-Csv $CsvFile -NoTypeInformation
  • #24166

    Points: 0
    Rank: Member

    I solved the issue I needed to remove $output and add

    $masterlist | Export-Csv $master -NoTypeInformation

The topic ‘Match and Update Csv’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort