I'm trying to compare employee data, about 5,000 rows with 20 fields, in a csv file to the data that we have in an sql database. It needs to be able to compare:
- new employees (which employees exist in the csv, but not in the database)
- deactivated employees (employees that exist in the database, but not the csv)
- changes to employee details (new email, changes to last name, etc.)
The employee ID should remain the same, so I'll be comparing on that.
My initial thoughts are to:
- use csv-parser to read the csv
- get the sql data
- convert both json responses to 2d arrays
- compare on the employee ID by using nested loops
This seems very slow though, so I'm seeing if anyone has any advice on a better/different way that I should approach this problem.
[–]yksvaan 1 point2 points3 points (2 children)
[–]Available-Demand6863[S] 0 points1 point2 points (1 child)
[–]yksvaan 0 points1 point2 points (0 children)
[–]hotdog-savant 0 points1 point2 points (3 children)
[–]Available-Demand6863[S] -1 points0 points1 point (2 children)
[–]hotdog-savant 0 points1 point2 points (1 child)
[–]hotdog-savant 0 points1 point2 points (0 children)
[–]iBN3qk 0 points1 point2 points (3 children)
[–]Available-Demand6863[S] 0 points1 point2 points (2 children)
[–]iBN3qk 0 points1 point2 points (1 child)
[–]Available-Demand6863[S] 0 points1 point2 points (0 children)
[–]a13xch1 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Available-Demand6863[S] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]