3 deleted 75 characters in body
source | link

I have a json file named xyz.json as follows

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

I need to copy the object "annotations" from "filename": "vc00_02201.png" to "annotations" of "filename": "vc00_02204.png" within the same xyz.json file using a shell script. Expected output:

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

please can anyone help me in making out this possible with shell script

I have a json file named xyz.json as follows

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

I need to copy the object "annotations" from "filename": "vc00_02201.png" to "annotations" of "filename": "vc00_02204.png" within the same xyz.json file using a shell script. Expected output:

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

please can anyone help me in making out this possible with shell script

I have a json file named xyz.json as follows

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

I need to copy the object "annotations" from "filename": "vc00_02201.png" to "annotations" of "filename": "vc00_02204.png" within the same xyz.json file using a shell script. Expected output:

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]
    Tweeted twitter.com/StackUnix/status/1082925033704644608
2 code formatting as blocks to avoid the weird white between lines
source | link

I have a json file named xyz.json as follows [ { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02201.png" }, { "annotations": [], "class": "image", "filename": "vc00_02202.png" } { "annotations": [], "class": "image", "filename": "vc00_02203.png" }, { "annotations": [], "class": "image", "filename": "vc00_02204.png" } ]

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

I need to copy the object "annotations" from "filename": "vc00_02201.png" to "annotations" of "filename": "vc00_02204.png" within the same xyz.json file using a shell script. Expected output: [ { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02201.png" }, { "annotations": [], "class": "image", "filename": "vc00_02202.png" } { "annotations": [], "class": "image", "filename": "vc00_02203.png" }, { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02204.png" } ] please

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

please can anyone help me in making out this possible with shell script

I have a json file named xyz.json as follows [ { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02201.png" }, { "annotations": [], "class": "image", "filename": "vc00_02202.png" } { "annotations": [], "class": "image", "filename": "vc00_02203.png" }, { "annotations": [], "class": "image", "filename": "vc00_02204.png" } ]

I need to copy the object "annotations" from "filename": "vc00_02201.png" to "annotations" of "filename": "vc00_02204.png" within the same xyz.json file using a shell script. Expected output: [ { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02201.png" }, { "annotations": [], "class": "image", "filename": "vc00_02202.png" } { "annotations": [], "class": "image", "filename": "vc00_02203.png" }, { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02204.png" } ] please can anyone help me in making out this possible with shell script

I have a json file named xyz.json as follows

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

I need to copy the object "annotations" from "filename": "vc00_02201.png" to "annotations" of "filename": "vc00_02204.png" within the same xyz.json file using a shell script. Expected output:

[
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02201.png"
    },
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02202.png"
    }
    {
        "annotations": [],
        "class": "image",
        "filename": "vc00_02203.png"
    },
    {
        "annotations": [ "a" , "b" , "c" ],
        "class": "image",
        "filename": "vc00_02204.png"
    }
]

please can anyone help me in making out this possible with shell script

1
source | link

parse JSON and malipulate its object values

I have a json file named xyz.json as follows [ { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02201.png" }, { "annotations": [], "class": "image", "filename": "vc00_02202.png" } { "annotations": [], "class": "image", "filename": "vc00_02203.png" }, { "annotations": [], "class": "image", "filename": "vc00_02204.png" } ]

I need to copy the object "annotations" from "filename": "vc00_02201.png" to "annotations" of "filename": "vc00_02204.png" within the same xyz.json file using a shell script. Expected output: [ { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02201.png" }, { "annotations": [], "class": "image", "filename": "vc00_02202.png" } { "annotations": [], "class": "image", "filename": "vc00_02203.png" }, { "annotations": [ "a" , "b" , "c" ], "class": "image", "filename": "vc00_02204.png" } ] please can anyone help me in making out this possible with shell script