<?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: Getting rid of blank line in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403174#M681982</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;One way:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/^\s*$//' file&lt;BR /&gt;&lt;BR /&gt;...and if you want to update in place :&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/^\s*$//' file&lt;BR /&gt;&lt;BR /&gt;...which will create a backup of the input file as 'file.old'.  This technique eliminates have to redirect to a temporary file and then overwrite your original file with the temporary one.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Fri, 17 Apr 2009 13:38:12 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-04-17T13:38:12Z</dc:date>
    <item>
      <title>Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403173#M681981</link>
      <description>Hi guys i want to get rid of a blank line in the output of a file... Lets say i have an output &lt;BR /&gt;&lt;BR /&gt;sp02 97216 Mbytes allocated to /dev/vgDEVsap across 7 PVs. PE size is 16 Mbyes, total of 6076 PE with 723 free&lt;BR /&gt;&lt;BR /&gt;sp02 97216 Mbytes allocated to /dev/vgDEVsap across 7 PVs. PE size is 16 Mbyes, total of 6076 PE with 723 free&lt;BR /&gt;&lt;BR /&gt;sp02 236096 Mbytes allocated to /dev/vgDEVdata across 17 PVs. PE size is 16&lt;BR /&gt;bytes, total of 14756 PE with 0 free&lt;BR /&gt;&lt;BR /&gt;Now, i am getting this blank line after each entry that i want to get rid of.. Let me know what you think.&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Apr 2009 13:34:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403173#M681981</guid>
      <dc:creator>khilari</dc:creator>
      <dc:date>2009-04-17T13:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403174#M681982</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;One way:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/^\s*$//' file&lt;BR /&gt;&lt;BR /&gt;...and if you want to update in place :&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/^\s*$//' file&lt;BR /&gt;&lt;BR /&gt;...which will create a backup of the input file as 'file.old'.  This technique eliminates have to redirect to a temporary file and then overwrite your original file with the temporary one.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 17 Apr 2009 13:38:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403174#M681982</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-17T13:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403175#M681983</link>
      <description>Or, with sed:&lt;BR /&gt;&lt;BR /&gt;sed '/^$/d'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 17 Apr 2009 13:40:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403175#M681983</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2009-04-17T13:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403176#M681984</link>
      <description>Hi Khilari,&lt;BR /&gt;&lt;BR /&gt;You can easily get rid out of this using simple grep.&lt;BR /&gt;&lt;BR /&gt;#grep -v ^$ filename &amp;gt; newfilename&lt;BR /&gt;&lt;BR /&gt;Hope this helps.</description>
      <pubDate>Fri, 17 Apr 2009 14:53:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403176#M681984</guid>
      <dc:creator>Ganesan R</dc:creator>
      <dc:date>2009-04-17T14:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403177#M681985</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Unfortunately, using the regular expresssion (RE):&lt;BR /&gt;&lt;BR /&gt;/^$/&lt;BR /&gt;&lt;BR /&gt;...only rids the file of lines that consist solely of a newline.  That is, any leading spaces and/or tabs will cause the RE _not_ to match.&lt;BR /&gt;&lt;BR /&gt;If you don't wish to use Perl (where '\s' means whitespace (spaces, tabs), then you probably want:&lt;BR /&gt;&lt;BR /&gt;# sed -e '/^[  ]*$/d' file&lt;BR /&gt;&lt;BR /&gt;...where the character class in square brackets consists of a space _and_ a TAB character.  Some 'sed' variants will allow:&lt;BR /&gt;&lt;BR /&gt;\t&lt;BR /&gt;&lt;BR /&gt;...to represent a TAB and you could be clearer by writing:&lt;BR /&gt;&lt;BR /&gt;# sed -d '/^[ \t]*$/d' file&lt;BR /&gt;&lt;BR /&gt;HP-UX doesn't understand this later notation.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Apr 2009 16:08:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403177#M681985</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-17T16:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403178#M681986</link>
      <description>I assume the output is coming from a script - why not modify the script and remove the part that prints the new line?</description>
      <pubDate>Fri, 17 Apr 2009 17:08:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403178#M681986</guid>
      <dc:creator>Torsten.</dc:creator>
      <dc:date>2009-04-17T17:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403179#M681987</link>
      <description>The absolutely simplest way to remove a blank line:&lt;BR /&gt; &lt;BR /&gt;awk NF /your/file&lt;BR /&gt;or&lt;BR /&gt;awk NF /your/oldfile &amp;gt; /your/newfile&lt;BR /&gt; &lt;BR /&gt;It will remove any line that is null or contains nothing bu blanks or tabs. But as mentioned, you might want to fix the code that is outputting the extra line.</description>
      <pubDate>Sat, 18 Apr 2009 02:02:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403179#M681987</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2009-04-18T02:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403180#M681988</link>
      <description>&amp;gt;JRF: Unfortunately, using the regular expresssion (RE): /^$/ ...&lt;BR /&gt;&lt;BR /&gt;You can simply use a character class:&lt;BR /&gt;grep -v '^[[:space:]]*$'&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60130/regexp.5.html#d0e1178990" target="_blank"&gt;http://docs.hp.com/en/B2355-60130/regexp.5.html#d0e1178990&lt;/A&gt;</description>
      <pubDate>Sat, 18 Apr 2009 03:49:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403180#M681988</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-04-18T03:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Getting rid of blank line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403181#M681989</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Where I used the term "character class" for the bracketed space+TAB character, I should properly have said "bracket expression".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 18 Apr 2009 12:44:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-rid-of-blank-line/m-p/4403181#M681989</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-18T12:44:08Z</dc:date>
    </item>
  </channel>
</rss>

