forked from flexo45/qamock_service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.groovy
47 lines (36 loc) · 1.24 KB
/
parser.groovy
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
def payments_data = "C:\\Work\\test123\\TRISTERO_CHARGES_MV.csv";
def tp_data = "C:\\Work\\test123\\TP_NOTIFICATIONS_TRISTER.csv";
BufferedReader bufferedReader = new BufferedReader(new FileReader(payments_data))
String line
List<Map<String, String>> payment = []
List<Map<String, String>> tp = []
List<Map> mismatch = []
Map<String, String> match = null
while ((line = bufferedReader.readLine()) != null){
def lead_id = line.split(";")[0].replace("\"", "")
def count = line.split(";")[1].replace("\"", "")
payment.add([lead_id:lead_id, count:count])
}
bufferedReader = new BufferedReader(new FileReader(tp_data))
while ((line = bufferedReader.readLine()) != null){
def lead_id = line.split(";")[0].replace("\"", "")
def count = line.split(";")[1].replace("\"", "")
tp.add([lead_id:lead_id, count:count])
}
tp.each {
i_tp ->
match = null
System.out.println(tp.indexOf(i_tp))
payment.each {
py ->
def p_l = py.get("lead_id")
def tp_l = i_tp.get("lead_id")
if(p_l.equals(tp_l)){
match = py
}
}
if(match == null){
mismatch.add(i_tp)
System.out.println(i_tp)
}
}