I need to change certain characters between two patterns in each line.
Eample :: (file contents saved as myfile.txt file)
abc, def, 1, {,jsdfsd,kfgdsf,lgfgd}, 2, pqr, stu
abc, def, 1, {,jsdfsqwe,k,fdfsfl}, 2, pqr, stu
abc, def, 1, {,asdasdj,kgfdgdf,ldsfsdf}, 2, pqr, stu
abc, def, 1, {,jsds,kfdsf,fdsl}, 2, pqr, stu
I want to edit and save myfile.txt as below
abc, def, 1, {jsdfsd kfgdsf lgfgd}, 2, pqr, stu
abc, def, 1, {jsdfsqwe k fdfsfl}, 2, pqr, stu
abc, def, 1, {asdasdj kgfdgdf ldsfsdf}, 2, pqr, stu
abc, def, 1, {jsds kfdsf fdsl}, 2, pqr, stu
I used the following command to edit and save myfile.txt
sed '/1,/,/,2/{/1,/n;/,2/!{s/,/ /g}}' myfile.txt
This team did not help me achieve my goal. Please help solve this problem.