LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-11-2014, 06:53 AM   #1
EduPorteņo
LQ Newbie
 
Registered: Oct 2012
Location: Argentina
Distribution: Ubuntu - Knoppix
Posts: 23
Blog Entries: 2

Rep: Reputation: Disabled
How do I use sed for replacing ' by apostrophe?


I have an html source which says things like "Where do you feel a woman's place is", I want it to say "Where do you feel a woman's place is".
I've tried 's/'/'/g' pages.csv and sed 's/'/\'/g' pages.csv to no avail.
If I use @ for the apostrophe it works well.
Any idea?
 
Old 01-11-2014, 07:11 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Try this:
Code:
sed "s/'/'/" infile
Example:
Code:
$ cat foo.in
Where do you feel a woman's place is

 $ sed "s/'/'/" foo.in
Where do you feel a woman's place is
This would also work:
Code:
$ sed 's/'/'\''/' foo.in

Last edited by druuna; 01-11-2014 at 07:14 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: What's your New Year's resolution? We share open source ideas for 2014. LXer Syndicated Linux News 0 01-01-2014 09:00 AM
LXer: Expanding the 'Covered Business Method' program: Sensible patent reform ... and why opponents LXer Syndicated Linux News 0 09-25-2013 06:10 PM
LXer: The 'big tent' letter urging patent litigaiton reform LXer Syndicated Linux News 0 07-23-2013 09:10 AM
replacing with sed dipuasks Linux - General 13 12-31-2008 11:24 AM
sed matching an apostrophe dazdaz Linux - General 2 04-28-2006 05:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration