如何在csv结构的JavaScript中制作2d数组

时间:2014-04-04 21:00:36

标签: javascript arrays csv

结构如下所示:

REP name,ID,Doctor name,speciality,Hospital,city
Abd A,3-1KPLCI,ASHWA,DERMATOLOGIST,ZULEKHA,SHARJAH
Abd A,3-1MSZMC,VINOD,INTERNIST,ZULEKHA,SHARJAH
Abd A,3-2MTAJU,ALI N,EMERGENCY,AL GARHO,NONE
Abd A,3-2S1WOT,ABDUL,GENERAL PRACTITIONER,CITY HOS,BUR DUBAI

我想获得2D数组。喜欢这个

[
["Abd A","3-1KPLCI","ASHWA","DERMATOLOGIST"],
["Abd A","3-1MSZMC","VINOD","INTERNIST"],
[...................]
]

如何使用JavaScript?

更新: 其实我不读csv文件。我将在脚本中手动复制csv数据。但JavaScript会创建2D数组,以便我可以执行下一个过程。

0 个答案:

没有答案