<?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: Removing constant pattern and whitespaces. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759102#M945162</link>
    <description>if you want the output to be :&lt;BR /&gt;pglc0000&lt;BR /&gt;pglc0001&lt;BR /&gt;etc.&lt;BR /&gt;&lt;BR /&gt;I'd tend to use:&lt;BR /&gt;grep '[a-zA-Z]' | cut -f1 -d. &amp;gt; output.txt&lt;BR /&gt;&lt;BR /&gt;I can think of other ways using sed etc. but this would be quicker&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Steven</description>
    <pubDate>Tue, 09 Jul 2002 01:13:57 GMT</pubDate>
    <dc:creator>Procnus</dc:creator>
    <dc:date>2002-07-09T01:13:57Z</dc:date>
    <item>
      <title>Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759093#M945153</link>
      <description>HI,&lt;BR /&gt;&lt;BR /&gt;I would like to remove every instance of the following pattern:&lt;BR /&gt;.output&lt;BR /&gt;=============&lt;BR /&gt;&lt;BR /&gt;from the file attached. This pattern is a subset of the pattern:&lt;BR /&gt;pglc0003.output&lt;BR /&gt;=============&lt;BR /&gt;&lt;BR /&gt;As there are whitespaces separating each entries, how do I write a script to eliminate those whitespaces and at the same time remove the mentioned pattern?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Jul 2002 07:21:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759093#M945153</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-07-08T07:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759094#M945154</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;cat file|while read line&lt;BR /&gt;do&lt;BR /&gt;echo |sed -e 's/.output//'|grep -v "======="&lt;BR /&gt;done|strings  &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;            Steve Steel</description>
      <pubDate>Mon, 08 Jul 2002 07:32:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759094#M945154</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-07-08T07:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759095#M945155</link>
      <description>I hope You have more than one file to process.&lt;BR /&gt;&lt;BR /&gt;This small script will help you.&lt;BR /&gt;&lt;BR /&gt;...............................&lt;BR /&gt;#!/usr/contrib/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;while(&lt;STDIN&gt;){&lt;BR /&gt;&lt;BR /&gt;      s/^\s*$//;&lt;BR /&gt;      s/\.output//;&lt;BR /&gt;      print;&lt;BR /&gt;     &lt;BR /&gt;     }&lt;BR /&gt;&lt;BR /&gt;...............................&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;run this script as $ cat text_file | script &lt;BR /&gt;or&lt;BR /&gt;$ script &amp;lt; text file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;&lt;BR /&gt;Karvendhan M&lt;BR /&gt;&lt;/STDIN&gt;</description>
      <pubDate>Mon, 08 Jul 2002 08:02:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759095#M945155</guid>
      <dc:creator>Karvendhan M</dc:creator>
      <dc:date>2002-07-08T08:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759096#M945156</link>
      <description>Sorry ,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I missed the === .. pattern.&lt;BR /&gt;&lt;BR /&gt;the script can be&lt;BR /&gt;----------------------------------&lt;BR /&gt;&lt;BR /&gt;#!/usr/contrib/bin/perl -w&lt;BR /&gt;while(&lt;STDIN&gt;){&lt;BR /&gt;s/^\s*$//;    # remove blank lines.&lt;BR /&gt;s/^\=+\s*$//; # Remove === ..&lt;BR /&gt;s/\.output//; # Remove .output.&lt;BR /&gt;s/^\s+//;     # remove leading space in lines.&lt;BR /&gt;print;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------&lt;BR /&gt;&lt;BR /&gt;~ Karvendhan M.&lt;BR /&gt;&lt;BR /&gt;&lt;/STDIN&gt;</description>
      <pubDate>Mon, 08 Jul 2002 08:18:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759096#M945156</guid>
      <dc:creator>Karvendhan M</dc:creator>
      <dc:date>2002-07-08T08:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759097#M945157</link>
      <description># to remove .output :&lt;BR /&gt;while read $a&lt;BR /&gt;basename $a .output&lt;BR /&gt;done &lt;FILENAME&gt;tmpfile1&lt;BR /&gt;&lt;BR /&gt;# to remove ================&lt;BR /&gt;&lt;BR /&gt;cat tmpfile1 |tr -s "=" &amp;gt;tmpfile2&lt;BR /&gt;&lt;BR /&gt;# to remove whitespaces&lt;BR /&gt;&lt;BR /&gt;cat tmpfile2 |tr -s " " &amp;gt;tmpfile3&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Mon, 08 Jul 2002 08:30:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759097#M945157</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-07-08T08:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759098#M945158</link>
      <description>Sorry&lt;BR /&gt;&lt;BR /&gt;I forgot "do".&lt;BR /&gt;&lt;BR /&gt;While read $a do&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Jul 2002 08:32:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759098#M945158</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-07-08T08:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759099#M945159</link>
      <description>Steve,&lt;BR /&gt;I tried running your code exactly as you've shown me:&lt;BR /&gt;&lt;BR /&gt;cat filename|while read line&lt;BR /&gt;do &lt;BR /&gt;echo |sed -e 's/.output//'|grep -v "====="&lt;BR /&gt;done|strings &amp;gt; newfile.txt&lt;BR /&gt;&lt;BR /&gt;However, the file "newfile" does not contain any outputs. &lt;BR /&gt;&lt;BR /&gt;Could you help me out?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Mon, 08 Jul 2002 08:34:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759099#M945159</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-07-08T08:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759100#M945160</link>
      <description>hi&lt;BR /&gt;&lt;BR /&gt;Steve's script should be....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo $line |sed -e 's/ .....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;&lt;BR /&gt;Karvendhan M&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Jul 2002 08:37:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759100#M945160</guid>
      <dc:creator>Karvendhan M</dc:creator>
      <dc:date>2002-07-08T08:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759101#M945161</link>
      <description>Steve,&lt;BR /&gt;&lt;BR /&gt;the line sed -e 's/.output//'|grep -v "===="&lt;BR /&gt;should remove the .output pattern followin the patterns pglc.., right?&lt;BR /&gt;&lt;BR /&gt;Unfortunately, it's printing :&lt;BR /&gt;pglc0002.output&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;for all of its output. &lt;BR /&gt;&lt;BR /&gt;Could you please help me out?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Mon, 08 Jul 2002 08:57:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759101#M945161</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-07-08T08:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759102#M945162</link>
      <description>if you want the output to be :&lt;BR /&gt;pglc0000&lt;BR /&gt;pglc0001&lt;BR /&gt;etc.&lt;BR /&gt;&lt;BR /&gt;I'd tend to use:&lt;BR /&gt;grep '[a-zA-Z]' | cut -f1 -d. &amp;gt; output.txt&lt;BR /&gt;&lt;BR /&gt;I can think of other ways using sed etc. but this would be quicker&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Steven</description>
      <pubDate>Tue, 09 Jul 2002 01:13:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759102#M945162</guid>
      <dc:creator>Procnus</dc:creator>
      <dc:date>2002-07-09T01:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759103#M945163</link>
      <description>Chern,&lt;BR /&gt;&lt;BR /&gt;Try Steve's script again, just modify the &amp;gt; newfile.txt to &amp;gt;&amp;gt; newfile.txt&lt;BR /&gt;&lt;BR /&gt;ME</description>
      <pubDate>Tue, 09 Jul 2002 14:24:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759103#M945163</guid>
      <dc:creator>Mark Ellzey</dc:creator>
      <dc:date>2002-07-09T14:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759104#M945164</link>
      <description>oops, forgot something...&lt;BR /&gt;if you want the output to be : &lt;BR /&gt;pglc0000 &lt;BR /&gt;pglc0001 &lt;BR /&gt;etc. &lt;BR /&gt;&lt;BR /&gt;I'd tend to use: &lt;BR /&gt;grep '[a-zA-Z]' &lt;INPUT file="" /&gt; | cut -f1 -d. &amp;gt; output.txt &lt;BR /&gt;&lt;BR /&gt;I can think of other ways using sed etc. but this would be quicker &lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Steven</description>
      <pubDate>Tue, 09 Jul 2002 20:11:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759104#M945164</guid>
      <dc:creator>Procnus</dc:creator>
      <dc:date>2002-07-09T20:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Removing constant pattern and whitespaces.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759105#M945165</link>
      <description>I am assumming you want to get output like:&lt;BR /&gt;     pglc0003&lt;BR /&gt;     pglc0004&lt;BR /&gt;     pglc0005&lt;BR /&gt;&lt;BR /&gt; etc.&lt;BR /&gt;&lt;BR /&gt;Use:&lt;BR /&gt;    cat yourfile | grep output | sed s/\.output//g &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Jul 2002 21:15:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-constant-pattern-and-whitespaces/m-p/2759105#M945165</guid>
      <dc:creator>Dave Chamberlin</dc:creator>
      <dc:date>2002-07-09T21:15:40Z</dc:date>
    </item>
  </channel>
</rss>

