Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. const csv = require('csv-parser');
  2. const fs = require('fs');
  3. const weshareJson = require('./weshare.json');
  4.  
  5. let wegather = [];
  6. let weshare = [];
  7. let missing = [];
  8.  
  9. fs.createReadStream('wegather.csv')
  10. .pipe(csv())
  11. .on('data', (row) => {
  12. wegather.push(row['WeShare Payment ID']);
  13. })
  14. .on('end', () => {
  15. weshare = weshareJson.map((row) => {
  16. return row.transactionId;
  17. });
  18.  
  19. weshare.forEach((row) => {
  20. if (!wegather.includes(row)) {
  21. console.log(row);
  22. }
  23. });
  24. console.log(weshare.length);
  25. console.log(wegather.length);
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement