-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.go
75 lines (39 loc) · 2.02 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
.
Compare two csv files to check which email addresses are in common and which email addresses are missing in each file.
WHAT'S THE PURPOSE OF THIS SCRIPT?
- We needed a quick-to-use database debugging tool for a vey specific problem: to help in a daily check about the information being sent from the mailing program to the CRM, and in the inverse direction.
- This script creates lists with the common and missing email addresses to be investigated. It can be useful for other purposes as well.
- Besides unique email addresses it can compare sha256 hashes or Spanish ID numbers.
- Parsing and comparing a 41MB file with 400.000 email addresses against another 36MB file with 350.000 email addresses takes 9 seconds in a fast laptop.
GET HELP
./ecompare --help
HOW TO USE IT
Export CSV files
You'll need to export csvs with supporter data in Engaging Networks and create similar exports in Salesforce.
Compare CSV files
Download both files as csvs to the same folder as the script. Then, using the command line run the script as:
./ecompare -data=emails -A=fileA.csv -B=fileB.csv
-data specifies the type of data to compare. It can be emails, sha256, urls or dni (Spanish ID numbers)
-A and -B specify the names of both files.
Get details about the comparison
When running the script you'll get a quick report like this:
WHAT HAPPENED?
File A: fileA.csv
File B: fileB.csv
Parsed emails in fileA.csv : 229
Parsed emails in fileB.csv: 214
In fileB.csv but not in fileA.csv : 0 emails
In fileA.csv but not in fileB.csv : 15 emails
In both fileA.csv and fileB.csv : 214 emails
And the script always creates 3 files in the current folder with the results:
in-a-but-not-in-b.txt
in-b-but-not-in-a.txt
in-both-a-and-b.txt
The filenames describe it's content and running the script again will overwrite this 3 files.
Open this files with your plain/code text editor and investigate the inconsistencies in both your CRM and mailing programs.
To delete the 3 files created by ecompare:
./ecompare -trash
.
*/
package main