i would like to compare two csv-files, but i do not only want to find new lines and output them to a third csv-file, but changed lines aswell, and thats where i struggle.
My csv-files consist of these Headers:
Item Name,Manufacturer,Model Name,Category,Status,Company,Serial Number,Asset Tag,Notes,Model Number
As an example, I have my first csv-file with this data:
lptest,Dell,Dell XPS 15,Laptop,Ready to Deploy,MyCompany,XXXXX,YYYYYY,Active,empty lptest2,Dell,Dell XPS 15,Laptop,Ready to Deploy,MyCompany,XXXXX,YYYYYY,Active,empty
My new csv-file has this:
lptest,Dell,Dell XPS 15,Laptop,Ready to Deploy,MyCompany,XXXXX,YYYYYY,archived,empty lptest2,Dell,Dell XPS 15,Laptop,Ready to Deploy,MyCompany,XXXXX,YYYYYY,Active,empty lptest3,Dell,Dell XPS 15,Laptop,Ready to Deploy,MyCompany,XXXXX,YYYYYY,Active,empty
I would like the output to be:
lptest,Dell,Dell XPS 15,Laptop,Ready to Deploy,MyCompany,XXXXX,YYYYYY,archived,empty lptest3,Dell,Dell XPS 15,Laptop,Ready to Deploy,MyCompany,XXXXX,YYYYYY,Active,empty
Because the first line changed, and the last one is new.
Is this possible?
Currently the only thing I can find, is the compare-object
method, but that seems to only compare for one header if that changed and that is not what I want.
Would be great, if someone had an idea for the problem