Import a csv file into an existing excel worksheet


I am actually a student in France and i have to import a csv file into an existing powershell worksheet with powershell. The first file have a list of differenst softwares with their time of use and the number of times they were launched. ( Mai = May, Avril = April, Cumul = Total of all the months.

In the second file, I have only January and so I have to put it in the first file like the others months. ( There is also softwares that they are not in the first file so I have also to add them.

Thanks for your help.


If you have to deal with Excel sheets you should take a look at the great module from Doug Finke ImportExcel. That will probably make your life much easier then. :wink:

Thank you, I will try my program with this module and I will tell you if it worked

I install the module but I can not find anyone who has already done a script that could look like mine.

I need help to start my script .

Thank you in advance.

I script which can compare my two file and say me where are the different can be a good start I think.

To compare two files you can start with Compare-Object

Compare-Object -ReferenceObject $(Get-Content C:\test\testfile1.csv) -DifferenceObject $(Get-Content C:\test\testfile2.csv)

I suspect you will not find something perfectly fitting as your requirements are kind of very specific. So you will have to create something by yourself what extracts the according data from your Excel sheet and compares it to the additional data. Or you overthink your process of doing all this and use a fairly simply CSV file as data source and create a sophisticated Excel sheet what’s able to import this data and display or process them in the way you need. I’m sure Excel is easily able to do something like this.