<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sed on Michael’s Domain</title><link>https://jeltsch.org/en/tags/sed/</link><description>Recent content in Sed on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/sed/index.xml" rel="self" type="application/rss+xml"/><item><title>Deleting empty lines from text files (sed)</title><link>https://jeltsch.org/en/deleting_empty_lines_from_text_files_sed/</link><pubDate>Tue, 09 Aug 2005 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/deleting_empty_lines_from_text_files_sed/</guid><description>&lt;p&gt;The following sed command deletes empty lines (and those with white spaces only) from text files:&lt;/p&gt;
&lt;div class="codeblock syntax-highlight mb-3"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sed -e &amp;#39;/^ *$/d&amp;#39; infile.txt &amp;gt; outfile.txt&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;You have to be careful though: if you copied the textfile from a Macintosh this script maybe won&amp;rsquo;t work. You first have to convert the Macintosh textfile into a UNIX textfile!&lt;/p&gt;</description></item></channel></rss>