<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Replace multiple strings using sed</title>
	<atom:link href="http://www.linuxask.com/questions/replace-multiple-strings-using-sed/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxask.com/questions/replace-multiple-strings-using-sed</link>
	<description>Linux Ask! is a Q &#38; A web site specific for Linux related questions such as how to use common Linux commands.</description>
	<lastBuildDate>Mon, 23 Jan 2012 15:56:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Linux Ask!</title>
		<link>http://www.linuxask.com/questions/replace-multiple-strings-using-sed/comment-page-1#comment-1452</link>
		<dc:creator>Linux Ask!</dc:creator>
		<pubDate>Sat, 06 Aug 2011 04:19:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.linuxask.com/?p=195#comment-1452</guid>
		<description>@Mike

You can use character class, e.g.

echo &quot;?,.&quot; &#124; sed &#039;s/[?,.]/_/g&#039;</description>
		<content:encoded><![CDATA[<p>@Mike</p>
<p>You can use character class, e.g.</p>
<p>echo "?,." | sed 's/[?,.]/_/g'</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Cheung</title>
		<link>http://www.linuxask.com/questions/replace-multiple-strings-using-sed/comment-page-1#comment-1451</link>
		<dc:creator>Mike Cheung</dc:creator>
		<pubDate>Thu, 04 Aug 2011 19:03:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.linuxask.com/?p=195#comment-1451</guid>
		<description>I was wondering if you could use a single sed s command to replace multiple different strings with one string. In my case I need to replace all punctuation marks with an underscore. I understand I could write multiple sed s commands for &quot;.&quot;, &quot;?&quot; and &quot;!&quot;. I was just wondering if there was a cleaner way to do it.

For those who want to know this is for an Applescript for finding and editing iTunes tracks since iTunes automatically changes punctuation in the artist, album, and track name to an &quot;_&quot;.</description>
		<content:encoded><![CDATA[<p>I was wondering if you could use a single sed s command to replace multiple different strings with one string. In my case I need to replace all punctuation marks with an underscore. I understand I could write multiple sed s commands for ".", "?" and "!". I was just wondering if there was a cleaner way to do it.</p>
<p>For those who want to know this is for an Applescript for finding and editing iTunes tracks since iTunes automatically changes punctuation in the artist, album, and track name to an "_".</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Howarth</title>
		<link>http://www.linuxask.com/questions/replace-multiple-strings-using-sed/comment-page-1#comment-1450</link>
		<dc:creator>Ian Howarth</dc:creator>
		<pubDate>Tue, 26 Jul 2011 11:50:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.linuxask.com/?p=195#comment-1450</guid>
		<description>Or 

sed &quot;s/str1/str2/g ; s/strA/strB/g ; s/foo/bar/g&quot; file1 &gt; file2</description>
		<content:encoded><![CDATA[<p>Or </p>
<p>sed "s/str1/str2/g ; s/strA/strB/g ; s/foo/bar/g" file1 &gt; file2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris F.A. Johnson</title>
		<link>http://www.linuxask.com/questions/replace-multiple-strings-using-sed/comment-page-1#comment-3</link>
		<dc:creator>Chris F.A. Johnson</dc:creator>
		<pubDate>Sat, 26 Dec 2009 18:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.linuxask.com/?p=195#comment-3</guid>
		<description>Or you can include all in a single, newline-separated string:

sed &#039;s/a/A/g
s/b/B/g
s/c/C/g&#039;  new.txt</description>
		<content:encoded><![CDATA[<p>Or you can include all in a single, newline-separated string:</p>
<p>sed 's/a/A/g<br />
s/b/B/g<br />
s/c/C/g'  new.txt</p>
]]></content:encoded>
	</item>
</channel>
</rss>

