compare csvs and update value in one of them

Welcome Forums General PowerShell Q&A compare csvs and update value in one of them

Viewing 1 reply thread
  • Author
    Posts
    • #229822
      Participant
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member

      I have three csvs. CSV1 has the all the usernames I need to find “info” for. Half the usernames are in CSV2 and HALF in CSV3.

      I need to cycle through the usernames found in CSV1 and compare to usernames CSV2 and CSV3 and update “info” in CSV1 if the username is found in either CSV2 or CSV3.

      csv1=
      username, info
      bob, <is currently blank>
      dirk, <is currently blank>
      john, <is currently blank>
      jill, <is currently blank>

      csv2,=
      username
      john
      jill

      csv3=
      username
      bob
      dirk

      I’m sure this is easy, I’m just having difficulty wrapping my head around it today. Any help is appreciated, still learning.

      • This topic was modified 6 days, 7 hours ago by twinsd30.
    • #229831
      Participant
      Topics: 12
      Replies: 1610
      Points: 2,508
      Helping Hand
      Rank: Community Hero

      twinsd30, welcome to Powershell.org. Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.

      When you post code, error messages, sample data or console output format it as code, please.
      In the “Text” view you can use the code tags “PRE“, in the “Visual” view you can use the format template “Preformatted“. You can go back edit your post and fix the formatting – you don’t have to create a new one.
      Thanks in advance.

      This a common question in the forums, look at this:

      Merge 2 large arrays based on a single matching property into new PsObject array

Viewing 1 reply thread
  • You must be logged in to reply to this topic.