Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const {
  2.   readFileSync,
  3.   writeFileSync,
  4. } = require('fs')
  5.  
  6. const raw = readFileSync('./Zinder.txt').toString()
  7.  
  8. const separated = raw.split('}{')
  9. const withComma = separated.join('},{')
  10. const fixedWithArray = `[${withComma}]`
  11.  
  12. const final = JSON.parse(fixedWithArray)
  13.   .map(el => el.id).join('\n')
  14.  
  15. writeFileSync('final.txt', final)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement