var fs = require('fs');
fs.readFile('dataset_136818_4.txt', function(err, logData) {
if (err) { throw err; }
var text = logData.toString();
var lines = text.split('\n');
var parts;
for (var i = 0; i < lines.length; i++) {
parts = lines[i].split('\t');
var arr1 = [], arr2 = [], arr3 = [];
parts.forEach(function(part) {
arr1.push(part[0]);
arr2.push(part[1]);
arr3.push(part[2]);
})
console.log(parts);
}
})
[ '6', 'S', '1' ]
[ '7', 'F', '1' ]
[ '6', 'C', '1' ]
[ '6', 'N', '1' ]
[ '1', 'F', '1' ]
[ '1', 'H', '1' ]
[ '8', 'E', '1' ]
.....
parts = lines[i].split('\t');
var firstArr = [];
parts.forEach(function(part) {
firstArr.push(part[0])
})
['6']
['7']
['8']
......
['6','7', дальше числа из первой строки изначального массива]
, ['Shorter','Fraser', дальше слова из второй строки исходного массива]
, ['157','157', дальше числа из третьей строки исходного массива]
[ '6', 'Shorter', '157\r' ]
[ '7', 'Fraser', '157\r' ]
[ '6', 'Chandter', '156\r' ]
[ '6', 'Nevill', '155\r' ]
[ '11', 'Ford', '175\r' ]
[ '10', 'Howard', '165\r' ]
[ '8', 'Erickson', '165\r' ]
[ '10', 'Albertson', '166\r' ]
[ '10', 'Day', '170\r' ]
[ '10', 'Elmers', '168\r' ]
[ '5', 'Bush', '149\r' ]
[ '3', 'Farmer', '131\r' ]
[ '11', 'Farmer', '180\r' ]
[ '9', 'Goldman', '168\r' ]
[ '10', 'Murphy', '174\r' ]
[ '6', 'Wesley', '152\r' ]
[ '9', 'Goodman', '167\r' ]
[ '10', 'Stanley', '174\r' ]
[ '3', 'Dowman', '138\r' ]
[ '11', 'Croftoon', '177\r' ]
[ '11', 'Wayne', '174\r' ]
[ '8', 'MacAlister', '163\r' ]
[ '4', 'Philips', '144\r' ]
[ '3', 'Kirk', '131\r' ]
[ '1', 'Youmans', '124\r' ]
[ '1', 'Leapman', '122\r' ]
[ '8', 'Stanley', '170\r' ]
[ '6', 'Dickinson', '158\r' ]
[ '5', 'Wallace', '145\r' ]
[ '2', 'MacAdam', '127\r' ]
[ '9', 'Marshman', '175\r' ]
[ '2', 'Nelson', '128\r' ]
[ '5', 'Haig', '150\r' ]
[ '3', 'Fisher', '138\r' ]
[ '1', 'Baldwin', '120\r' ]
[ '8', 'Kingsman', '161\r' ]