Accessing nested values in a table

Great. If you can’t change your “CSV”-esque format and need to convert it on the fly to 3D JSONArray, just:

  1. ( --> [
  2. ) --> ]
  3. \n --> , (assuming no blank last line)
  4. add a single [ ] pair around the beginning/end of the whole thing

so this (your file):

[(40.65, 20.30, 120.92, 86.12, 99.33), (10.35, 90.10, 10.52, 1.12, 59.3), (10.65, 62.10, 12.12, 96.23, 19.3)]
[(96.37, 67.13, 312.62, 87.11, 87.18), (90.94, 41.04, 63.01, 9.10, 30.3), (11.98, 99.01, 41.30, 16.04, 10.4)]
[(11.88, 12.98, 182.22, 13.84, 81.09), (50.35, 10.10, 10.52, 8.12, 91.3), (88.51, 21.66, 81.13, 36.13, 97.3)]

becomes this (valid JSON):

[[[40.65, 20.30, 120.92, 86.12, 99.33], [10.35, 90.1, 10.52, 1.12, 59.3], [10.65, 62.1, 12.12, 96.23, 19.3]],
[[96.37, 67.13, 312.62, 87.11, 87.18], [90.94, 41.04, 63.01, 9.10, 30.3], [11.98, 99.01, 41.30, 16.04, 10.4]],
[[11.88, 12.98, 182.22, 13.84, 81.09], [50.35, 10.10, 10.52, 8.12, 91.3], [88.51, 21.66, 81.13, 36.13, 97.3]]]
2 Likes