0

Good afternoon, Stack Overflow!

To begin, I would like to say that I'm extremely new to the world of scripting but am eager to learn as much as I can. Currently, I am trying to learn how to create a script that would compare two different CSV files for discrepancies and then output to another Excel sheet the discrepancies.

One one sheet, there are a bunch of columns of data for which I only need a couple columns of. For example: File 1: Name;Bug;Status;Due Date;Nonsense;Bananas;Issue Key

File 2: Name;Bug;Status;Cross Reference;Status;Due Date

One thing I would like to point out is that the "Issue Key" column is synonymous with "Cross Reference" in File 2. I know that I could use this to my advantage but can't seem to understand how to start. I'd like to be able to compare the data for 3 to 4 columns between the two files and see any changes/discrepancies.

Vu Nguyen
  • 37
  • 5
  • 1
    It looks like where you need to start is some powershell tutorials like https://www.guru99.com/powershell-tutorial.html and specifically tutorials/documentation on using import-csv https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7 – TJ Rockefeller Jan 20 '20 at 22:22
  • 1
    The general intention of StackOverflow is to help you in situations where you run into an specific issue with your own script. In the post [In Powershell, what's the best way to join two tables into one?](https://stackoverflow.com/q/1848821/1701026) are several references to similar questions with examples and answers, or search for something like: `[PowerShell] merge csv` or `[PowerShell] join object`, you might use them for a starter, and if you run into an issue, place your more specific question in here (also see: [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask). – iRon Jan 21 '20 at 06:35
  • Thank you for the guidance! I will check it out. – Vu Nguyen Jan 22 '20 at 18:17

1 Answers1

0

Is there a reason you want to use PowerShell? So far from what you describe it seems it would make more sense to use a differencing tool. https://winmerge.org/ is one such example and there are lots of others out there. OTOH If this is something you need to do consistently on a large scale it would probably make more sense to do it programmatically.

CM42
  • 80
  • 7
  • Hi there! So currently I am working on projects out of SharePoint and Jira and would like to be able to extract the information daily in order to see the changes that are being made. Right now, we have a manual process of copying and pasting into an Excel file with macros set up to calculate the deltas. However, the effort is to use PowerShell to create a script in order to do this. – Vu Nguyen Jan 21 '20 at 19:01