Re: Insert caret just before specified character
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Organization | SYMC |
| Message-ID | <20150501124639.08410c57@symmactoolkit-c02n3u69g3qj.symc.symantec.com> |
PLLC[U [Fri, 1 May 2015 12:38:42 -0700]:
> 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"
[...]
Try enclosing the entire string in double-quotes or single-quotes,
something like echo "("errors":...}}" | sed ...
-Amarendra