Skip to content

Instantly share code, notes, and snippets.

@jesslilly
Created February 4, 2014 18:19
Show Gist options
  • Save jesslilly/8809296 to your computer and use it in GitHub Desktop.
Save jesslilly/8809296 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var fs = require('fs');
var _ = require('underscore');
fs.readFile('area.json',function(err,data) {
var a = JSON.parse(data);
console.log(a.length);
var b = _.map(a,function(row) {
var o = new Object();
o.area = row.at4;
o.node = row.at9;
return o;
});
console.log(b.length);
fs.writeFile('area2.json',JSON.stringify(b),function() {
console.log("Done!");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment