phd/assets/preliminary-work/script.js

15 lines
313 B
JavaScript
Raw Normal View History

2019-08-28 11:39:20 +02:00
const fs = require('fs');
const step = 50;
let input = fs.readFileSync('cdf-full.dat', 'utf-8')
.split('\n')
.map((x) => x.split(' '));
let output = [];
for (let i = 0; i < input.length; i += step) {
output.push(input[i]);
}
fs.writeFileSync('cdf.dat', output.map((x) => x.join(' ')).join('\n'));