-1

大きな JSON ファイルの各行に複数のネストされたデータ項目があります。

JSON ファイルの行の例: {"Key1":{"Key2":"value2"},{"Key3":{"Key4:"Value4"}}}}

ファイルのサイズはほぼ 2GB です。CSV に変換する必要があります。

したがって、ここには2つの主要な問題があります。

  1. n 次元データを 2d CSV 形式で表現するにはどうすればよいですか?
  2. データを CSV で表現する方法を思いついたとしても、JSON からどのように変換するのでしょうか。

どんな考えでも大歓迎です。

4

1 に答える 1

0

1/ That's a problem. That really depends on the structure of your file. In this case, you could use 3 columns, like

firstKey secondKey value
Key1     Key2      value2
Key3     Key4      value4

but that could also be very different

2/ you'd need a stream parsing method. most likely your entire json structure won't fit in memory

于 2012-09-17T14:57:50.543 に答える