А если вот такого плана,
file example:
1,2,3,4
5,6,7,8
То варианты (на nodejs):
fs=require("fs")
var s = fs.readFileSync("test.scv", "ascii")
console.log(
s.split(/\r?\n/).filter(function(x){return x}).map(function(x){return x.split(",")}) //>>>> [ [ '1', '2', '3', '4' ], [ '5', '6', '7', '8' ] ]
)
console.log(
s.replace(/\r?\n/g, ",").split(",").filter(function(x){return x}) //>>>> [ '1', '2', '3', '4', '5', '6', '7', '8' ]
)
console.log(
s.split(/\r?\n/).filter(function(x){return x}).map(function(x){return x.split(",").map(function(x){return +x})}) //>>>> [ [ 1, 2, 3, 4 ], [ 5, 6, 7, 8 ] ]
)
console.log(
s.replace(/\r?\n/g, ",").split(",").filter(function(x){return x}).map(function(x){return +x}) //>>>> [ 1, 2, 3, 4, 5, 6, 7, 8 ]
)