2

I am trying to parse a variant of this file (instead of using tab as delimiter I am using a file that has comma as delimiter) https://github.com/materechm/Schizophrenia/blob/master/GWAS.txt

This is my code, but I am getting an empty array and no errors

        var csv = Papa.parse('GWAS.csv', {
        delimiter: ",",
        header: true,
        comments: false,
        complete: function(results) {
        console.log(results);
        }
        });
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
user3089079
  • 59
  • 1
  • 7
  • Possible duplicate of [How can I read a local file with Papa Parse?](https://stackoverflow.com/questions/49752889/how-can-i-read-a-local-file-with-papa-parse) – Evan Carroll Dec 28 '18 at 22:15

1 Answers1

2

There is no data because you have header row enabled, so the first line of the input is the header row (look in the meta property for the list of fields found in the header row).

You've supplied only one line of input, literally the string "GWAS.csv", so there is no data.

If you meant to parse a file, you need to either pass in a File object from the DOM or specify download: true in the config for Papa Parse to interpret the input string as a URL from which to download the input file.

Matt
  • 22,721
  • 17
  • 71
  • 112