I typically use this format structure for my 3D json arrays and import using AJAX:
{
"c2array":true,
"size":[2,3,4],
"data":[
[ [0,1,2,3], [0,1,2,3], [0,1,2,3] ],
[
[0,1,2,3], [0,1,2,3], [0,1,2,3] ]
]
}
C2 seems to be quite happy accepting the newlines (unless I'm misunderstanding you ).