update a csv file

Welcome Forums General PowerShell Q&A update a csv file

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
3 weeks, 4 days ago.

  • Author
    Posts
  • #146189

    Participant
    Points: 72
    Rank: Member

    hello ladies & gents,

    a new day, a new problem 😉

    I need to update an existing CSV file by pulling some information on computers and adding that info to the csv file. This script will run on thousands of computers and each computer adds its info to the file. I'm testing on 3 only for now.

    So far, everything works fine except a detail that I do not know how to fix: for each line that my script adds to the file, the column titles are repeated. which gives something like:

    PC Name – App Name – Version

    PC1 – Adobe Reader – 11.0.12

    PC Name – App Name – Version

    PC2 – Adobe reader – 11.0.15

    ….

    How can I write only the values to the csv?

    thank you!

  • #146196

    Participant
    Points: 1,373
    Helping Hand
    Rank: Community Hero

    Without seeing your code we could only take a vague guess what's wrong in your code. So you will have to show it here. 😉 You can edit your initial post and add the code – formatted as code please.

  • #146213

    Moderator
    Points: 1,976
    Helping Hand
    Rank: Community Hero

    I think you are doing string building to create a csv file, this will be very simple in PowerShell way. But like @olaf-soyk mentioned, without seeing your code it's very difficult to help. If original code sharing is not possible, you can share a sample code which is similar to you actual code.

  • #146550

    Participant
    Points: 72
    Rank: Member

    I think you are doing string building to create a csv file, this will be very simple in PowerShell way. But like @olaf-soyk mentioned, without seeing your code it's very difficult to help. If original code sharing is not possible, you can share a sample code which is similar to you actual code.

    you gave me the hint I needed, it now works as I want. I managed the data as a string and it now correctly reports to the csv file.

    thanks!

You must be logged in to reply to this topic.

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