<?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: Convert DOS line breaks to Unix line breaks</title>
	<atom:link href="http://www.tech-recipes.com/rx/200/convert-dos-line-breaks-to-unix-line-breaks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/200/convert-dos-line-breaks-to-unix-line-breaks/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Sat, 21 Nov 2009 22:16:28 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: </title>
		<link>http://www.tech-recipes.com/rx/200/convert-dos-line-breaks-to-unix-line-breaks/comment-page-1/#comment-2639</link>
		<dc:creator></dc:creator>
		<pubDate>Wed, 11 Jan 2006 05:18:12 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-2639</guid>
		<description>Running the command:

tr -d &#039;1532&#039; &lt; teste.f &gt; teste1.f

Cleans up my ctrl-m&#039;s but not the final ctrl-z. Anyone would happen to know why?</description>
		<content:encoded><![CDATA[<p>Running the command:</p>
<p>tr -d &#8216;1532&#8242; &lt; teste.f &gt; teste1.f</p>
<p>Cleans up my ctrl-m&#8217;s but not the final ctrl-z. Anyone would happen to know why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: </title>
		<link>http://www.tech-recipes.com/rx/200/convert-dos-line-breaks-to-unix-line-breaks/comment-page-1/#comment-1154</link>
		<dc:creator></dc:creator>
		<pubDate>Fri, 17 Dec 2004 18:24:40 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-1154</guid>
		<description>&lt;ul id=&quot;quote&quot;&gt;&lt;h6&gt;Doug Merritt wrote:&lt;/h6&gt;Bad advice, doesn&#039;t work! This says delete (-d)
all sequences of the form &quot;1532&quot;...that&#039;s wrong
for two reasons.

First, &quot;32&quot; is a typo, that&#039;s just
a random control character. &quot;12&quot; is the correct
octal escape for newline (and 15 is carriage
return).
&lt;/ul&gt;

15 is r.  Yes, you do want to delete all r&#039;s.

32 is CTRL-Z.  DOS text files have an EOF byte: 0x1a or 32 or ^Z.  This also removes that character.  Yes, you do want to delete all ^Z&#039;s.

So this is good advice and does work.  Did you try it?

I do agree with the other poster who said to use -i to edit the file in place, though.</description>
		<content:encoded><![CDATA[<ul id="quote">
<h6>Doug Merritt wrote:</h6>
<p>Bad advice, doesn&#8217;t work! This says delete (-d)<br />
all sequences of the form &#8220;1532&#8243;&#8230;that&#8217;s wrong<br />
for two reasons.</p>
<p>First, &#8220;32&#8243; is a typo, that&#8217;s just<br />
a random control character. &#8220;12&#8243; is the correct<br />
octal escape for newline (and 15 is carriage<br />
return).
</ul>
<p>15 is r.  Yes, you do want to delete all r&#8217;s.</p>
<p>32 is CTRL-Z.  DOS text files have an EOF byte: 0&#215;1a or 32 or ^Z.  This also removes that character.  Yes, you do want to delete all ^Z&#8217;s.</p>
<p>So this is good advice and does work.  Did you try it?</p>
<p>I do agree with the other poster who said to use -i to edit the file in place, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lazy</title>
		<link>http://www.tech-recipes.com/rx/200/convert-dos-line-breaks-to-unix-line-breaks/comment-page-1/#comment-1002</link>
		<dc:creator>lazy</dc:creator>
		<pubDate>Mon, 08 Nov 2004 11:15:03 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-1002</guid>
		<description>sed is made for these kind of things...

&gt; sed -i &quot;s/r//&quot; file.txt

If you want to keep a backup of the file just specify an extension.

&gt; sed -i.bak &quot;s/r//&quot; file.txt

Above line will create file.txt.bak as a copy of the original file.</description>
		<content:encoded><![CDATA[<p>sed is made for these kind of things&#8230;</p>
<p>&gt; sed -i &#8220;s/r//&#8221; file.txt</p>
<p>If you want to keep a backup of the file just specify an extension.</p>
<p>&gt; sed -i.bak &#8220;s/r//&#8221; file.txt</p>
<p>Above line will create file.txt.bak as a copy of the original file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Merritt</title>
		<link>http://www.tech-recipes.com/rx/200/convert-dos-line-breaks-to-unix-line-breaks/comment-page-1/#comment-18</link>
		<dc:creator>Doug Merritt</dc:creator>
		<pubDate>Sun, 02 Nov 2003 09:19:10 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-18</guid>
		<description>Bad advice, doesn&#039;t work! This says delete (-d)
all sequences of the form &quot;1532&quot;...that&#039;s wrong
for two reasons.

First, &quot;32&quot; is a typo, that&#039;s just
a random control character. &quot;12&quot; is the correct
octal escape for newline (and 15 is carriage
return).

This is better expressed as simply &quot;rn&quot; to avoid
such typos.

Second, you don&#039;t want to DELETE the line
ending altogether, you want to CHANGE it.

The quickest fix is to just delete all carriage
returns, leaving the newlines in place:

      tr -d &#039;15&quot; &lt; dos-format-file &gt; unix-friendly-file
or better
      tr -d &quot;r&quot; &lt; dos_file &gt; unix_file

There&#039;s also &quot;dos2unix&quot;, which comes with most
Linux/Unix systems I&#039;ve seen in the last 10 years:

     dos2unix -n dos_file new_unix_file</description>
		<content:encoded><![CDATA[<p>Bad advice, doesn&#8217;t work! This says delete (-d)<br />
all sequences of the form &#8220;1532&#8243;&#8230;that&#8217;s wrong<br />
for two reasons.</p>
<p>First, &#8220;32&#8243; is a typo, that&#8217;s just<br />
a random control character. &#8220;12&#8243; is the correct<br />
octal escape for newline (and 15 is carriage<br />
return).</p>
<p>This is better expressed as simply &#8220;rn&#8221; to avoid<br />
such typos.</p>
<p>Second, you don&#8217;t want to DELETE the line<br />
ending altogether, you want to CHANGE it.</p>
<p>The quickest fix is to just delete all carriage<br />
returns, leaving the newlines in place:</p>
<p>      tr -d &#8216;15&#8243; &lt; dos-format-file &gt; unix-friendly-file<br />
or better<br />
      tr -d &#8220;r&#8221; &lt; dos_file &gt; unix_file</p>
<p>There&#8217;s also &#8220;dos2unix&#8221;, which comes with most<br />
Linux/Unix systems I&#8217;ve seen in the last 10 years:</p>
<p>     dos2unix -n dos_file new_unix_file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: .</title>
		<link>http://www.tech-recipes.com/rx/200/convert-dos-line-breaks-to-unix-line-breaks/comment-page-1/#comment-11</link>
		<dc:creator>.</dc:creator>
		<pubDate>Sat, 25 Oct 2003 02:54:08 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-11</guid>
		<description>Or in a singl e shot
perl -pi -s &#039;rn/n/&#039;  filename
dos2unix filename.</description>
		<content:encoded><![CDATA[<p>Or in a singl e shot<br />
perl -pi -s &#8216;rn/n/&#8217;  filename<br />
dos2unix filename.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
