i have a following string:
{"name":"ram","details":[{'subjects':{'service_location':'c:/A.exe','url':'http://A.zip'}}]}
In the above string few strings have single quotes around them. so, how can i replace single quotes with double quotes in the above string and get as follows:
{"name":"ram","details":[{"subjects":{"service_location":"c:/A.exe","url":"http://A.zip"}}]}
@Learner: Try a sed solution:
sed "s/'/\"/g" Input_file
OR
your_command | sed "s/'/\"/g"
Extending @RavinderSingh13 answer, use following command to convert your string.
echo '{"name":"ram","details":'"[{'subjects':{'service_location':'c:/A.exe','url':'http://A.zip'}}]}" | sed "s/'/\"/g"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With