<?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: Text filtering and formatting ..... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572607#M30767</link>
    <description>&lt;BR /&gt;Another way for the first question :&lt;BR /&gt;&lt;BR /&gt;sort -u foo.txt&lt;BR /&gt;&lt;BR /&gt;(-u : like uniq command)&lt;BR /&gt;&lt;BR /&gt;For the second question try something like :&lt;BR /&gt;&lt;BR /&gt;line_size.sh :&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;for line in `sort -u $1`&lt;BR /&gt;do&lt;BR /&gt;    echo `echo $line | wc -c` $line&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;And after use :&lt;BR /&gt;&lt;BR /&gt;line_size.sh foo.txt | sort -k 1,1n | cut -f2 -d' '&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Herv?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 30 Aug 2001 06:12:49 GMT</pubDate>
    <dc:creator>Herve BRANGIER</dc:creator>
    <dc:date>2001-08-30T06:12:49Z</dc:date>
    <item>
      <title>Text filtering and formatting .....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572604#M30764</link>
      <description>1.How do I remove duplicate lines in a &lt;BR /&gt;text file after sorting .&lt;BR /&gt;ex:&lt;BR /&gt;1111&lt;BR /&gt;2222&lt;BR /&gt;2222&lt;BR /&gt;3333&lt;BR /&gt;3333&lt;BR /&gt;I need to have only &lt;BR /&gt;1111&lt;BR /&gt;2222&lt;BR /&gt;3333&lt;BR /&gt;2.How do I sort lines in a file based on the &lt;BR /&gt;length of the line.&lt;BR /&gt;ex:&lt;BR /&gt;234&lt;BR /&gt;eqwr&lt;BR /&gt;45678&lt;BR /&gt;dfghhjk&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;Karthik ...&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Aug 2001 05:39:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572604#M30764</guid>
      <dc:creator>Karthik_2</dc:creator>
      <dc:date>2001-08-30T05:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Text filtering and formatting .....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572605#M30765</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;For you first question use "uniq" command&lt;BR /&gt;(man uniq). For example :&lt;BR /&gt;&lt;BR /&gt;    uniq foo.txt | sort &lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Herv?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Aug 2001 05:46:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572605#M30765</guid>
      <dc:creator>Herve BRANGIER</dc:creator>
      <dc:date>2001-08-30T05:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Text filtering and formatting .....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572606#M30766</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;with 'sort -u' you can do sort and uniq in one command.&lt;BR /&gt;&lt;BR /&gt;For sorting length you can use this&lt;BR /&gt;&lt;BR /&gt;cat &lt;FILE&gt; | awk '{printf("%9d %s\n",length($0),$0);}' | sort -n | cut -c11-&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/FILE&gt;</description>
      <pubDate>Thu, 30 Aug 2001 06:07:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572606#M30766</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-08-30T06:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Text filtering and formatting .....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572607#M30767</link>
      <description>&lt;BR /&gt;Another way for the first question :&lt;BR /&gt;&lt;BR /&gt;sort -u foo.txt&lt;BR /&gt;&lt;BR /&gt;(-u : like uniq command)&lt;BR /&gt;&lt;BR /&gt;For the second question try something like :&lt;BR /&gt;&lt;BR /&gt;line_size.sh :&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;for line in `sort -u $1`&lt;BR /&gt;do&lt;BR /&gt;    echo `echo $line | wc -c` $line&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;And after use :&lt;BR /&gt;&lt;BR /&gt;line_size.sh foo.txt | sort -k 1,1n | cut -f2 -d' '&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Herv?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Aug 2001 06:12:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572607#M30767</guid>
      <dc:creator>Herve BRANGIER</dc:creator>
      <dc:date>2001-08-30T06:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Text filtering and formatting .....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572608#M30768</link>
      <description>This is the way I handle this.&lt;BR /&gt;&lt;BR /&gt;Cat text1 &amp;gt; text&lt;BR /&gt;cat text1 &amp;gt;&amp;gt; text&lt;BR /&gt;sort text |uniq -d&lt;BR /&gt;&lt;BR /&gt;Try this cheap method out.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Aug 2001 14:12:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-filtering-and-formatting/m-p/2572608#M30768</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2001-08-30T14:12:45Z</dc:date>
    </item>
  </channel>
</rss>

