How to Diff Two BOMs
With each revision to a electrical circuit board more often then not there are going to be changes to the bill of materials. This guide will explain how you can diff two different Bill of Materials (BOM) using software tools rather then a) having to manually track changes or b) manually comparing line by line of a BOM to determine which parts have changed.
Potential reasons for needing to do this:
- While debugging you’re latest hardware revision, you may encounter strange behavior that you didn’t have on your previous revision. Diff’ing your BOM can help identify potential part changes that could be causing the strange behavior.
- You may already have stock left of the components used on your previous revision and want to determine which parts have changed so you only have to order the parts you didn’t have before.
- Export both BOMs into a format which is tab delimited.
- Download a diff tool. There are many free tools available that should be able to do the exact same thing. I used a diff tool called Compare It!. A free trial is available on this website.
- Inside the tool. On the left side open the old bom and on the right side open the new bom.
- Once you’ve opened the 2nd bom, the tool will show you each of the differences. If you just needed to see the differences then you can stop reading.
- If you want to get a report of only the items which have changed, then go to File->Report and select composite as the report type. Click generate.
- In Excel, File->Open on the Files of type filter select Text Files and then select the file that you created in the previous step. If a Text Import Wizard appears just go through it making any selections you see fit. The default values were okay for me (tab delimited).
- In the workbook that opens you should notice that some lines have <! or !> at the beginning. <! indicates what that line used to equal and !> indicates what the new row is.
- Next, highlight the first column by clicking on the A above the first column.
- Then, click the sort button which is an icon that has an A above a Z. (see the above screenshot). A warning prompt will appear. Make sure Expand the selection is selected and click sort.
- Now all the entries with the !> should be grouped together. Highlight them all and copy them to the clipboard.
- Open a new workbook and then paste.
- Finally, press CTRL-H or goto Edit->Replace and set it to Find: !> and Replace it with nothing.
- You’re finished!
If anyone knows of a diff tool that will let you export only the changes to the newer file, please post a comment. I searched around for a bit but i realized it’d take longer then doing the extra steps in excel.