问题标签 [papaparse]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
3708 浏览

javascript - PapaParse 不工作(返回空数组)

我正在尝试解析此文件的变体(而不是使用制表符作为分隔符,我使用的是逗号作为分隔符的文件)https://github.com/materechm/Schizophrenia/blob/master/GWAS.txt

这是我的代码,但我得到一个空数组并且没有错误

0 投票
1 回答
6236 浏览

javascript - Displaying CSV Headers using PapaParse Plugin

I am using the PapaParse plugin for csv files. I have this function below that creates a table to display the CSV results.

Even with header:true set, I can not seem to get the headers to show up in the table but the rest displays perfectly.

And to be honest, I found this script online and am having trouble even understanding how it is working.

Any ideas? Thank you in advance!

0 投票
1 回答
640 浏览

javascript - How can I cache a csv for Papa Parse to parse?

I am very unfamiliar with how caching works, and so I was wondering how I could pull a csv off a server the first time, but on subsequent refreshes use a cached csv file?

I know how to get the file from the server, and parse it via PapaParse. However, I do not know how to make that csv cached, or even how to access the cache via PapaParse.

Going further with this, how could I then check how long ago this csv file has been updated, and if it needs to be updated pull the csv off the server again? I understand there is a lastModified property in Javascript but it is unclear whether or not that works for cached files.

0 投票
1 回答
1449 浏览

javascript - 使用 Papa Parse 为什么我不能引用已解析的数据?

我正在使用 Papa Parse 解析 csv 文件。在“完成”中,我尝试将结果(对象数组)分配给我在调用 Papa Parse 的 parse 函数之外声明的变量。该变量在函数内部很好,但在外部未定义。我也用字符串和整数尝试了这个,但变量在函数之外仍然是未定义的。

0 投票
1 回答
1186 浏览

javascript - CSV文件到变量挣扎,使用 papa.parse

好的,目标是从文件中复制 CSV 并将它们作为字符串存储在 javascript 中。

使用 Papaparse 我已经设法从 CSV 文件中获取内容,但我似乎无法将字符串保存在 papaparse 之外以在另一个脚本中使用。

我对 javascript 非常陌生,所以请善待 :)

while 循环是根据我的需要调整格式,但是,如果我可以获取数据,我可以在它当前所在的位置之外执行此操作。欢迎任何帮助,因为这让我发疯!非常感谢!!:D

0 投票
4 回答
6417 浏览

javascript - PapaParse 与 Angular JS

喜欢 PapaParse 的 CSV 解析器和解析器。谁能帮我把这个与Angular JS结合起来。

我喜欢让 PapaParse 以 Angular 方式工作。正在尝试解决方案。

0 投票
1 回答
5436 浏览

javascript - ReferenceError: 爸爸没有定义

所以我正在尝试设置 PapaParser 将 CSV 文件解析到数组中,以便稍后与另一个脚本一起使用来制作图表。到目前为止,我只想将数组中的字符串粘贴到空白 div 上,这样我就可以看到发生了什么。我是新手,不知道如何导入 javascript 库,所以我将文件复制到我的 public_html 文件夹中。现在 NetBeans 似乎看到了它们。

长话短说我一开始就卡住了,我得到了 ReferenceError: Papa is not defined 当我尝试运行我的解析器时的引用。

任何关于如何执行此操作的输入或教程链接将不胜感激(尝试谷歌搜索,发现没有任何用处)。到目前为止,我已经添加了我的代码......

0 投票
4 回答
8273 浏览

javascript - 读取 CSV 时,PapaParse 返回 undefined

我的目标是打开一个 CSV 文件,然后<div>使用 PapaParse 将其内容解析到一个。到目前为止,它似乎正在工作,但它只是返回未定义的而不是实际值。我不知道出了什么问题,可能是一个奇怪的 CSV 文件(我用另存为的 excel 表制作了这个文件),或者它可能只是草率的编码。

JS

HTML

编辑:这是我一直在测试的文件(http://www.topdeckandwreck.com/excel%20graphs/)。不知道这是否真的相关,因为这样做的目标是让用户能够打开任何 CSV 文件,然后从中制作图表:)

0 投票
2 回答
5924 浏览

papaparse - PapaParse 错误解释

我正在使用 papaParse 将 CSV 文件解析为 JSON 以供进一步使用。解析后它返回

有人可以向我解释这是什么意思吗?我阅读了他们网页上的文档,但仍然不明白出了什么问题

我正在使用的 CSV 文件是这个(http://www.topdeckandwreck.com/excel%20graphs/Sheet10.csv

0 投票
1 回答
1954 浏览

jquery - 引用 papaparse 输出数组

我正在使用 papaParse 解析 CVS 文件。然后我想使用数组中的特定数据,但不知道如何引用它。我可以像这样在控制台中看到它:

到目前为止,这是我的代码:

所以假设我想 console.log(data:Array0[5]),什么是合适的语法?谢谢