如何在java中读取CSV和JSON文件时加快处理速度?

时间:2017-06-28 11:18:59

标签: java json csv

所以我在java中创建了一个运行程序,将现有库与csv文件进行比较。我的问题是,对于我的库中的每个对象,CSV总共需要105641行。

该程序的工作方式如下:

Read all CSVs
Put in CSVList
Get all Objects in Library(JSON)
Loop each Objects
   Loop CSVList
      Compare Objects and CSV
          Display any mismatch 

图书馆结构:

{
    "Library1": [{
            "id": 0,
            "Group": "Group_Name",
            "name": "Unique_Name_in_Group",
            "CHAIN1": {
                "location": ["location1", "location2", "location3", "location4"],
                "role": [["Role1"], ["Role2"], ["Role3"], ["Role4"], ["Role5"], ["Role6"]]
            },
            "CHAIN2": {
                "location": ["location1", "location2", "location3"],
                "role": [["Role1"], ["Role2"], ["Role3"], ["Role4"], ["Role5"], ["Role6"], ["Role7"], ["Role8"]]
            },
            "CHAIN3": {
                "SUBCHAIN": ["Subchain1", "Subchain2", "Subchain3", "Subchain4"],
                "location": ["location1", "location2", "location3", "location4"],
                "role": [["Role1"], ["Role2"], ["Role3"], ["Role4"], ["Role5"], ["Role6"]]
            }
        },
        .
        .
        .

}

我的CSV:

  • 结构(5列): [Group_Name] [名称] [位置] [角色]
  • 排序: A-Z来自左右
  • 1 CSV = 1链/子链
  • CHAIN1..n是CSV的名称

0 个答案:

没有答案