Advertisement
danilomalzao

Untitled

Sep 11th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. var csvContent = "title*, filter, Color_Red, Color_Green, Color_Blue, \n\
  2. Hidrografia, 1.0\\,==, 0, 0, 255, \n\
  3. Nuvem, 2.0\,==, 0, 255, 255, \n\
  4. Floresta, 3.0\,==, 38, 115, 0, \n\
  5. Nao floresta, 4.0\,==, 255, 74, 255,";
  6. var lines = csvContent.split(/[\n]+/);
  7. var matrix = [];
  8. for (var iLine = 0, lineCount = lines.length; iLine < lineCount; iLine++){
  9. matrix.push(lines[iLine].split(/[ \s\t]*(?<!\\),[ \s\t]*/));
  10. }
  11. console.log("Matrix", matrix)
  12. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement