Skip to main content

Hi, i failed to convert this format to an CSV with header

 

Has anyone seen this type of structure before?

Thanks for all

{
    "nbResults": "2",
    "columnList": "
        "THE_LIBELLE",
        "THE_ACTIF",
        "THE_DT_CREA",
        "THE_UTIL_CREA",
        "THE_DT_DERN_MAJ",
        "THE_UTIL_DERN_MAJ",
        "THE_ORDRE"
    ],
    "keyList":  
        "THE_ID"
    ],
    "rowList": r
        {
            "columnDataList":  
                "Commercial",
                "1",
                "11/10/2022 18:15",
                "Test X",
                "11/10/2022 18:15",
                "Test Y",
                "1"
            ],
            "keyDataList": "
                "1"
            ]
        },
        {
            "columnDataList": /
                "Culturelle",
                "1",
                "11/10/2022 18:15",
                "Test X",
                "11/10/2022 18:15",
                "Test Y",
                "2"
            ],
            "keyDataList": b
                "2"
            ]
        }
    ]
}

The easiest may be to read the file using the Text File reader (make sure to configure it to read the whole file at once) and then use a couple of JSONFragmenters to extract the schema definition ("columnList") and/or the table contents ("rowList").

For example to extract the table contents:

imageGives you:

imageIf the schema is always the same, you could skip reading the schema definition and simply use something like an AttributeManager to rename the list items as needed, e.g.

imageIf the schema can differ and the workspace needs to be fully dynamic, it's going to be more complicated ;-)


Reply