The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

How to convert collection of documents into single json document ?

HarshavHarshav Member Posts: 33 Learner II
I executed data to json operator and flatten the collection ,I got collection of documents as you can see in the below screenshot .





How to store this into one single proper json format file ?

Answers

  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Hi,

    RapidMiner doesn't have this kind of JSON processing capabilities. 
    You could put the data one by one into a JSON capable database like PostgreSQL and use the functionality built in to group the JSON documents, for example. Or one of the scripting languages supported by RapidMiner: Groovy, Python or R.

    If the number of documents is not too large, you could try processing the collection with Loop Collection and add all the elements to a macro with Generate Macro.

    Create Macro with "[" as the starting point, then add the elements from the connection and "," (but not for the last element), and finally close it with "]". That would result in the macro having a valid JSON array. 

    Regards,
    Balázs
  • frederic_gomer_frederic_gomer_ Member Posts: 4 Contributor I
    edited July 2021
    Hi,

    We don't have a view on your process.


    If you're after a loop value, you can use append superset operator to make example of your object collection and connect to Data To JSON operator check generate array and finally connect to Write Document by specify youfile.json (enter a path before ex: C:\DATA\youfile.json) encoding UTF8 and check overwrite.






Sign In or Register to comment.