Merge Promo+ and CDS CSVs

Script to merge Promo+ and CDS CSV files from a folder into a single export file with optional progress reporting.

Use Case

Takes a folder path containing multiple CSV files, separates Promo+ and CDS data based on the presence of a uuid field, merges the records by matching User Id or hashedKocid with an ID type, and writes the merged results into a single CSV file named ngps_cds_export.csv in the same folder. The script handles large datasets by splitting the merged data into batches of 50,000 rows to avoid memory issues. If a CDS record is missing for a given Promo+ user, the merged record includes a noSuchUser field with a descriptive message.

Example Input:

A CSV file containing the Promo+ data and a CSV file (or files) containing the CDS data:

  "folderPath": "C:/folder/promo+_export.csv"
  "folderPath": "C:/folder/cds_export.csv"
  "folderPath": "C:/folder/cds_export2.csv"

Example Output:

A merged CSV containing both the Promo+ and CDS data in the same folder as input:

  "folderPath": "C:/folder/npgs_cds_data.csv"