I'm running into a problem. If I have only tsv's file name. How can i extract all its information and save it in an array, say X, where each row in the tsv file is represented by an array, say y, where X is an array of ys.
ALso how can i do this if i don't know the headers of columns names ?
You're going to need to use AJAX or just pure XMLHttpRequest.
http://d3js.org/ has a built-in tsv reader that does basically exactly what you want.
The syntax is
d3.tsv("file.tsv", function(data) {
// use data here
});
The data
variable is an array of objects with key/value pairs where the first row in the file is read in as the keys. So, for example
Number Awesomeness
1 5
2 3
will return [{"Number":1, "Awesomeness":5}, {"Number":2, "Awesomeness":3}]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With