Created
February 22, 2022 23:37
-
-
Save salif/6bbc0d5ff4f40b8d41eafd0cf52efa29 to your computer and use it in GitHub Desktop.
Get JSON with all words from pbd171.db
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 words = require('./temp.json') | |
const fs = require('fs') | |
for (let i = 0; i < words.length; i+=1904) { | |
const lcode = 'word_'+words[i].lan_code | |
for (let j = 0; j < 1904; j++) { | |
words[j][lcode] = words[i+j].word | |
} | |
} | |
for (let j = 0; j < 1904; j++) { | |
delete words[j]['word'] | |
delete words[j]['lan_code'] | |
} | |
fs.writeFile('words.json', JSON.stringify(words.slice(0, 1904)), 'utf8', console.log) |
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
sqlite3 -json pbd171.db "select * from tblWords" > temp.json | |
node get_json.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run
script.bash