Created
July 24, 2013 18:03
-
-
Save benjamind/6072948 to your computer and use it in GitHub Desktop.
This is a simple nodejs script that massages our stats data into separate files which we can use in OpenSCAD to produce 3d models.
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 = '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