Created
January 11, 2022 19:43
-
-
Save aliahmadcse/e85ea789cb740a574d412921735909cb to your computer and use it in GitHub Desktop.
Backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
let data = fs.readFileSync("./quicksearch.json"); | |
data = data.toString().trim().split("\n").map(JSON.parse); | |
const usernames = new Set(); | |
for (let row of data) { | |
if (row.headers) { | |
usernames.add(row.headers.username); | |
} | |
} | |
console.log(usernames); | |
// TODO: need a database call to fetch emails against these usernames | |
//TODO: need to map users email to username param | |
// TODO: need decision on updating username in message field (require string manipulation -> error prone) | |
const output = data.map(JSON.stringify).join("\n"); | |
fs.writeFileSync("output-quicksearch.json", output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment