we want to relapse the [1023,1024,1022]
as described in the following file , with [1022]
more file.exm
{"topic":"nj_hgf_dfgef","partition":0,"replicas":[1023,1024,1022]},
{"topic":"nj_hgf_dfgef","partition":1,"replicas":[1024,1022,1023]},
{"topic":"nj_hgf_dfgef","partition":2,"replicas":[1022,1023,1024]},
expected output
{"topic":"nj_hgf_dfgef","partition":0,"replicas":[1022]},
{"topic":"nj_hgf_dfgef","partition":1,"replicas":[1022]},
{"topic":"nj_hgf_dfgef","partition":2,"replicas":[1022]},
we try
sed -i s'/[0-9],[0-9],[0-9]/[1022]/g' file.exm
but without success