1

I use Newtonsoft.Json library for serializing and deserializing .NET objects. One of the things I am serializing are tables (represented as List<List<int>>). What I need is to format them in the serialized file like a table, not like a bunch of columns as they are formatted now. Is there any way to achieve this?

Now, I have the following formatting in the json-file:

"Table": [
          [
            1024,
            1024,
            1024,
            1024    
          ],
          [
            1024,
            1024,
            1024,
            1024
          ],
          [
            1024,
            1024,
            1024,      
            1024           
          ]
         ]

What I want to achieve is this:

"Table": [
          [1024, 1024, 1024, 1024],
          [1024, 1024, 1024, 1024],
          [1024, 1024, 1024, 1024]                           
         ]
Peter17
  • 3,052
  • 9
  • 47
  • 77

1 Answers1

2

I you want a more compact format there are already some comments below your question about that.
If you want more readability you could use a list of mapping of columnName to columnValue by List<Map<string /*columndName*/, int>>

brgerner
  • 4,287
  • 4
  • 23
  • 38