1752815 Members
6109 Online
108789 Solutions
New Discussion юеВ

Add single quote

 
SOLVED
Go to solution
Allanm
Super Advisor

Add single quote


I want to add a single quote to another single quote in a file. How do I do that?

the file is -

Allan's
Kelly Martha
Joe Chang's

So I want the output as -

Allan''s
Kelly Martha
Joe Chang''s

Thanks,
Allan
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: Add single quote

Hi Allan:

I find Perl the easist way (using the Ascii octal values):

# perl -pe 's/\047/\047\047/g' file

# perl -pi.old -e 's/\047/\047\047/g' file

...where the later updates "file" in-place.

Regards!

...JRF...
Allanm
Super Advisor

Re: Add single quote

Thanks JRF!

Allan.