[TriLUG] Change string with special character
Thomas
thomasvt at gmail.com
Fri May 18 12:25:53 EDT 2007
Craig,
That worked !! Thanks a lot. I have been struggling with this for a day.
And you helped me in under 1 hr. Have a nice weekend.
Regards,
Thomas
On 5/18/07, Craig Taylor <ctalkobt at gmail.com> wrote:
> On 5/18/07, Thomas <thomasvt at gmail.com> wrote:
> >
> > Hello,
> >
> > I need to change a string in a file
> >
> > \303\215 (all characters) with Í (LATIN CAPITAL LETTER I WITH ACUTE
> > ie: echo '\0315')
> > [...]
> > Thanks,
> > Thomas
> >
>
>
>
> echo '\303\215' | sed "s/[\\]303[\\]215/@/" | tr "@" "\315"
>
> Note that I couldn't get the character 315 in the sed string directly so I
> used a '@' temporarily. TR is only for characters so won't work here.
>
> Note: There's probably a better way to represent literal \ in a sed string
> but [\\] works and I did it with-out use of the man page. :-)
>
> Feel free to change '@' to '@SOMELONGSTRING' that won't match anything else.
> --
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
>
More information about the TriLUG
mailing list