Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
This is a simple nodejs script that massages our stats data into separate files which we can use in OpenSCAD to produce 3d models.
var filename = 'response-times-15min',
fs = require('fs'),
out = [],
i = 0,
array = fs.readFileSync(filename + '.tsv').toString().split('\n');
for (i=0; i < array.length; i++) {
out.push(array[i]);
out.push(array[i]);
fs.writeFileSync(filename + '-' + i + '.txt', array[i].toString() + "\n");
fs.appendFileSync(filename + '-' + i + '.txt', array[i]);
}
for (i=0; i < out.length; i++) {
fs.appendFileSync('./' + filename + '-double.txt', out[i].toString() + "\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment