Insert caret just before specified character
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
How do I add caret '^' before each comma ',' in text string? Trying this:
echo {"errors":{"subject_id":["mandatory","Contact not exist."]}} | sed.exe -e "s/,/^,/g"
but does not work. Also trying this:
echo {"errors":{"subject_id":["mandatory","Contact not exist."]}} | sed.exe -e "s/,/^^,/g"
because in windows shell caret is escape character. So in this case first carret should escape another one (which should remain), but it also does not work.
What am I doing wrong?
L.