Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var csvContent = "title*, filter, Color_Red, Color_Green, Color_Blue, \n\
- Hidrografia, 1.0\\,==, 0, 0, 255, \n\
- Nuvem, 2.0\,==, 0, 255, 255, \n\
- Floresta, 3.0\,==, 38, 115, 0, \n\
- Nao floresta, 4.0\,==, 255, 74, 255,";
- var lines = csvContent.split(/[\n]+/);
- var matrix = [];
- for (var iLine = 0, lineCount = lines.length; iLine < lineCount; iLine++){
- matrix.push(lines[iLine].split(/[ \s\t]*(?<!\\),[ \s\t]*/));
- }
- console.log("Matrix", matrix)
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement