-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremaining.js
More file actions
51 lines (40 loc) · 837 Bytes
/
remaining.js
File metadata and controls
51 lines (40 loc) · 837 Bytes
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
var LineByLineReader = require('line-by-line'),
lr = new LineByLineReader('out_3'),
lr2 = new LineByLineReader('scan_list');
let doubles = [];
let seen = [];
let seen_sl = [];
function exists(name) {
if (seen.find(x => x == name)) {
return true;
}
seen.push(name.trim());
//console.log('Seen ' + name.trim());
return false;
}
lr.on('error', function (err) {
// 'err' contains error object
});
lr.on('line', function (line) {
if (exists(line.split(' ')[0].slice(5))) {
//console.log('DOUBLE: ' + line);
} else {
//console.log(line);
}
});
lr2.on('line', function(line) {
seen_sl.push(line);
});
let fin = 0;
function d() {
fin++;
if(fin == 2) {
seen_sl.filter(x => !seen.find(y => y == x)).forEach(x => console.log(x));
}
}
lr2.on('end', function() {
d();
});
lr.on('end', function () {
d();
});