Created
October 30, 2012 15:33
-
-
Save peny/3980969 to your computer and use it in GitHub Desktop.
qod json field to .txt file
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
var filename = 'file.json'; | |
var fs = require('fs'); | |
var underscore = require('underscore'); | |
var data = fs.readFileSync(filename).toString(); | |
data = JSON.parse(data); | |
data = underscore.map(data,function(d){ | |
//change this | |
return d.field; | |
}); | |
data = underscore.uniq(data); | |
fs.writeFile('file.txt',data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment