<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Delete blanks lines in a text plain file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586644#M679387</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;# sed '/^$/d' testfile    # Delete blank Line from a file using sed</description>
    <pubDate>Thu, 18 Feb 2010 21:19:28 GMT</pubDate>
    <dc:creator>Hakki Aydin Ucar</dc:creator>
    <dc:date>2010-02-18T21:19:28Z</dc:date>
    <item>
      <title>Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586641#M679384</link>
      <description>Hi everyone...&lt;BR /&gt;You know, I've been looking for any kind of command with sed or awk for deleting blanks lines in a txt file on a HP-UX server.&lt;BR /&gt;I already got the filtered file and I found a web page in which they say with the expression "sed '/^$/d'" but this isn´t working for me.&lt;BR /&gt;Can anybody help me with this?&lt;BR /&gt;Thanks a lot!</description>
      <pubDate>Thu, 18 Feb 2010 20:16:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586641#M679384</guid>
      <dc:creator>Sergio Bascur</dc:creator>
      <dc:date>2010-02-18T20:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586642#M679385</link>
      <description>This works for me..&lt;BR /&gt;&lt;BR /&gt;sed /^$/d my.file&lt;BR /&gt;&lt;BR /&gt;post your error, maybe that will help ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Feb 2010 20:21:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586642#M679385</guid>
      <dc:creator>Tim Nelson</dc:creator>
      <dc:date>2010-02-18T20:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586643#M679386</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/^\s*$//' file&lt;BR /&gt;&lt;BR /&gt;...will eliminate all blank lines from your file after creating a backup copy suffixed with ".old".&lt;BR /&gt;&lt;BR /&gt;This works for lines that consist only of a newline or lines that have leading spaces and/or tab characters only.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 18 Feb 2010 20:48:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586643#M679386</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-02-18T20:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586644#M679387</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;# sed '/^$/d' testfile    # Delete blank Line from a file using sed</description>
      <pubDate>Thu, 18 Feb 2010 21:19:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586644#M679387</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-02-18T21:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586645#M679388</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;To be clear:&lt;BR /&gt;&lt;BR /&gt;# sed /^$/d file&lt;BR /&gt;&lt;BR /&gt;...will *not* delete "blank" lines unless those lines consist *only* of a newline character --- without leading whitespace.&lt;BR /&gt;&lt;BR /&gt;The Perl snippet I suggested works both for lines that consist only of a newline or lines that have leading spaces and/or tab characters only before the final newline character.&lt;BR /&gt;&lt;BR /&gt;If you insist on 'sed', this mimics the Perl snippet albeit without the inplace file modication:&lt;BR /&gt;&lt;BR /&gt;# sed -e '/^[   ]*$/d' file&lt;BR /&gt;&lt;BR /&gt;Notice carefully that the characters between the square brackets are really a blank and a tab.  HP-UX's 'sed' doesn't allow metacharacters like '\t' to a tab.  HP-UX's 'sed' doesn't allow inplace modification, either.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Feb 2010 21:32:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586645#M679388</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-02-18T21:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586646#M679389</link>
      <description>This will work as well:&lt;BR /&gt;&lt;BR /&gt;sed '/^[[:space:]]*$/d'&lt;BR /&gt;&lt;BR /&gt;And it has the benefit of being easier to read than the brackets with a &lt;SPACE&gt; and a &lt;TAB&gt; character between them.&lt;BR /&gt;&lt;/TAB&gt;&lt;/SPACE&gt;</description>
      <pubDate>Thu, 18 Feb 2010 21:38:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586646#M679389</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2010-02-18T21:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586647#M679390</link>
      <description>The shortest solution:&lt;BR /&gt; &lt;BR /&gt;awk NF data.txt&lt;BR /&gt; &lt;BR /&gt;This handles zero length lines, spaces and tabs -- any number on the blank lines.</description>
      <pubDate>Fri, 19 Feb 2010 02:27:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586647#M679390</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2010-02-19T02:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586648#M679391</link>
      <description>Hi Sergio,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; any kind of command with sed or awk&lt;BR /&gt;You got great answers for sed/awk. In case you look for anything else, try this: &lt;BR /&gt; &lt;BR /&gt;# more filename | grep -v ^$&lt;BR /&gt;&lt;BR /&gt;Regds..</description>
      <pubDate>Fri, 19 Feb 2010 03:24:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586648#M679391</guid>
      <dc:creator>R.K. #</dc:creator>
      <dc:date>2010-02-19T03:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586649#M679392</link>
      <description>&amp;gt;RK: more filename | grep -v ^$&lt;BR /&gt;&lt;BR /&gt;Not sure why you want more(1) involved?&lt;BR /&gt;(Unless you want to use -s to give grep a head start?  :-)&lt;BR /&gt;Just use: grep -v ^$ filename&lt;BR /&gt;Or: grep -v '^[[:space:]]*$' filename</description>
      <pubDate>Fri, 19 Feb 2010 03:34:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586649#M679392</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-02-19T03:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586650#M679393</link>
      <description>&amp;gt;&amp;gt;# more filename | grep -v ^$&lt;BR /&gt;&lt;BR /&gt;This will have the same problem as the initial 'sed' statement posted.  It will only match lines that consist of a "newline" character ONLY.  If there are spaces and/or tabs on the line that will not work.&lt;BR /&gt;&lt;BR /&gt;To take care of spaces and/or tabs you would have to do:&lt;BR /&gt;&lt;BR /&gt;# more filename | grep -v ^[[:space:]]*$&lt;BR /&gt;&lt;BR /&gt;or, even easier with spawning a unnecessary "more" process:&lt;BR /&gt;&lt;BR /&gt;# grep -v ^[[:space:]]*$ filename&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Feb 2010 03:37:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586650#M679393</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2010-02-19T03:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Delete blanks lines in a text plain file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586651#M679394</link>
      <description>Thanks Dennis and Patrick, I will surely go through these differences.</description>
      <pubDate>Fri, 19 Feb 2010 04:28:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-blanks-lines-in-a-text-plain-file/m-p/4586651#M679394</guid>
      <dc:creator>R.K. #</dc:creator>
      <dc:date>2010-02-19T04:28:46Z</dc:date>
    </item>
  </channel>
</rss>

