Forum Discussion

6 Replies

    • ForrestParker's avatar
      ForrestParker
      Qrew Cadet
      Dan, I was able to implement this solution exactly as you presented it and it works great!  However, I would like to create a CSV in this manner without the column headers.  Is that something that is easily done?
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      The variable csv is just a string with newlines separating each row.

      This will probably work:
          var csv2 = csv.split('\n').slice(1).join('\n');
          download("myuniquefile.csv", csv2);
      Very simple console test:
      csv="a,b\n1,2\n3,4"
      "a,b
      1,2
      3,4"
      csv.split('\n').slice(1).join('\n');
      "1,2
      3,4"