On building up on @Lauren answer. This code would work on JSONArrays(the sample provided has only one 1 JSONObject inside, this'll work even if there's more)
public static void main(String[] args) {
// Replace with your actual JSON string of load JSON from file
String jsonString = "[{\"id\":\"0028167072_CO_FIX_INTTV_1008_P3909_IDX0\",\"place\":[{\"@referredType\":\"street\",\"apartment\":\"578\",\"id\":\"8\",\"role\":\"QA\"}],\"ProductCharacteristic\":[{\"id\":\"CH_100473\",\"name\":\"Computer\",\"value\":\"LTS\",\"valueId\":\"CH12_1000374_VALUE04141\"}],\"startDate\":\"2023-02-12T22:00:00Z\",\"status\":\"Active\"}]";
JSONArray jsonArray = new JSONArray(jsonString);
for(int i=0;i<jsonArray.length();i++){
JSONObject jsonObject = jsonArray.getJSONObject(i);
JSONArray productCharacteristics = jsonObject.getJSONArray("ProductCharacteristic");
// Iterate through each "ProductCharacteristic" object and remove the "name"
// key-value pair
for (int j = 0; j < productCharacteristics.length(); j++) {
JSONObject productCharacteristic = productCharacteristics.getJSONObject(i);
productCharacteristic.remove("name");
}
}
String updatedJsonString = jsonArray.toString();
System.out.println("Modified JSON:\n" + updatedJsonString);
}
Although this works for JSONs which you have copied from the file. Use an input stream to read JSONs from the file. If an single valid JSON spans multiple lines, try and use an JSON streaming parser(I'd recommend Jackson) else the org.json's JSON library is enough.