How to match two databases, one has no duplicate key values, one has many duplicate key values?

24 views Asked by At

Okay, this is going to be a mouthful, but I'm interested to ask this question because I've been learning programming on my own time and I'm wondering if there is a programmatic approach to this problem.

I work at an ecommerce agency, and I have a client who would like to migrate from Volusion to Shopify. Their main concern is migrating their 'product reviews' database from Volusion into Shopify.

There are three .csv files I'm looking at.

  • One from Shopify, with SHOPIFY PRODUCT ID's matched to Product Names.

  • One from Volusion, with Volusion Product ID's matched to Product Names.

  • One from Volusion's Native Reviews, with Product Reviews matched to Volusion Product ID's.

Problem #1: The product ID's from Volusion do not match the Product ID's from Shopify.

Problem #2: There are multiple product reviews for each Volusion Product ID.

The goal is to match Volusion Product Reviews to SHOPIFY PRODUCT ID's, which would have to be done by:

  1. Matching Volusion Product Reviews to Volusion Product ID's (Done)
  2. Matching Volusion Product ID's to SHOPIFY PRODUCT ID's, which are different, but can be done through finding matching Product Names

Example of the CSV's:

Shopify Product Export CSV:

Product ID    Name
----          ----
2344          Leather Handbag
2345          Phone Case   

Volusion Product Export CSV:

Product ID    Name
----          ----
36754         Leather Handbag
36755         Phone Case

Volusion Reviews Export CSV:

Product ID    Review
----          ----
36754         Great Bag!
36754         Quality Leather!
36754         Amazing!
36755         Great Phone Case!

What would be the quickest way to build a CSV file with three columns: SHOPIFY PRODUCT ID, SHOPIFY PRODUCT NAME, VOLUSION PRODUCT REVIEW, MATCHED TO SHOPIFY PRODUCT ID BY PRODUCT NAME

So that the end result looks like:

Product ID    Name               Product Review
----          ----               ----
2344          Leather Handbag    Great Bag!
                                 Quality Leather!
                                 Amazing!
2345          Phone Case         Great Phone Case!

Is this possible?

Thanks everybody! :)

0

There are 0 answers