Ajout d'une ligne dans un fichier Json
Bonjour,
J'ai un fichier input Json il contient :
Code:
1 2 3 4
| { "anchorID": "01", "botID": "0000000000000b02", "distance": 3.5}
{"anchorID": "02", "botID": "0000000000000b02", "distance": 3.5}
{ "anchorID": "03", "botID": "0000000000000b02", "distance": 3.5}
{"anchorID": "02", "botID": "0000000000000b02", "distance": 3.5} |
Je veux ajouter {"anchorID": "05", "botID": "0000000000000b02", "distance": 2} dans le fichier output, à chaque fois où je trouve dans le fichier input "anchorID": "02
Du coup l'output sera:
Code:
1 2 3 4 5 6
| { "anchorID": "01", "botID": "0000000000000b02", "distance": 3.5}
{"anchorID": "02", "botID": "0000000000000b02", "distance": 3.5}
{"anchorID": "05", "botID": "0000000000000b02", "distance": 2}
{ "anchorID": "03", "botID": "0000000000000b02", "distance": 3.5}
{"anchorID": "02", "botID": "0000000000000b02", "distance": 3.5}
{"anchorID": "05", "botID": "0000000000000b02", "distance": 2} |
Merci d'avance