<?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: script to delete macthing lines in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702790#M901855</link>
    <description>In that case,&lt;BR /&gt;cat filename | uniq -u (but filename must already be sorted)</description>
    <pubDate>Fri, 12 Apr 2002 15:54:47 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2002-04-12T15:54:47Z</dc:date>
    <item>
      <title>script to delete macthing lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702786#M901851</link>
      <description>I have a huge file with few duplicate entries. I want to delete all duplicate entries from the file.&lt;BR /&gt;&lt;BR /&gt;original file &lt;BR /&gt;&lt;BR /&gt;xyz123abc&lt;BR /&gt;ghi567zxc&lt;BR /&gt;ghi567zxc&lt;BR /&gt;abc345000&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;output file&lt;BR /&gt;&lt;BR /&gt;xyz123abc&lt;BR /&gt;abc345000&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;The file is sorted do anybody have any script to do that?&lt;BR /&gt;&lt;BR /&gt;Thanks in advacne&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Apr 2002 15:46:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702786#M901851</guid>
      <dc:creator>John McDen</dc:creator>
      <dc:date>2002-04-12T15:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: script to delete macthing lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702787#M901852</link>
      <description>cat filename | sort -u</description>
      <pubDate>Fri, 12 Apr 2002 15:47:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702787#M901852</guid>
      <dc:creator>hpuxrox</dc:creator>
      <dc:date>2002-04-12T15:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: script to delete macthing lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702788#M901853</link>
      <description>no i want to delete both the lines .. sort -u is for unique&lt;BR /&gt;&lt;BR /&gt;Thanks anyway</description>
      <pubDate>Fri, 12 Apr 2002 15:51:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702788#M901853</guid>
      <dc:creator>John McDen</dc:creator>
      <dc:date>2002-04-12T15:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: script to delete macthing lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702789#M901854</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;cat original | sort -u &amp;gt; tempfile&lt;BR /&gt;&lt;BR /&gt;diff original tempfile &amp;gt; output_file&lt;BR /&gt;&lt;BR /&gt;john.</description>
      <pubDate>Fri, 12 Apr 2002 15:54:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702789#M901854</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-04-12T15:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: script to delete macthing lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702790#M901855</link>
      <description>In that case,&lt;BR /&gt;cat filename | uniq -u (but filename must already be sorted)</description>
      <pubDate>Fri, 12 Apr 2002 15:54:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702790#M901855</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-04-12T15:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: script to delete macthing lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702791#M901856</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Here is a simple shell script to strip duplicate lines in a file ...&lt;BR /&gt;&lt;BR /&gt;-------------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;# dup - Will search for duplicate lines in a file&lt;BR /&gt;&lt;BR /&gt;if [ -z "$1" ]; then&lt;BR /&gt; echo&lt;BR /&gt; echo "syntax: dup [filename]"&lt;BR /&gt; echo&lt;BR /&gt; exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;file=$1&lt;BR /&gt;&lt;BR /&gt;echo -n "Searching Dups..."&lt;BR /&gt;cat /dev/null &amp;gt; $file.n&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;  found=`grep "$line" $file.n`&lt;BR /&gt;  if [ -n "$found" ]; then&lt;BR /&gt;    echo -n "."&lt;BR /&gt;  else&lt;BR /&gt;    echo "$line" &amp;gt;&amp;gt; $file.n&lt;BR /&gt;  fi&lt;BR /&gt;done &amp;lt; $file&lt;BR /&gt;old=`wc -l $file | awk '{ print $1 }'`&lt;BR /&gt;new=`wc -l $file.n | awk '{ print $1 }'`&lt;BR /&gt;&lt;BR /&gt;echo "`expr $old - $new` dups found"&lt;BR /&gt;echo "Newfile: $file.n"&lt;BR /&gt;--------------&lt;BR /&gt;Syntax is:&lt;BR /&gt;&lt;BR /&gt;prompt&amp;gt;scriptname &lt;INPUTFILE&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu&lt;/INPUTFILE&gt;</description>
      <pubDate>Fri, 12 Apr 2002 15:55:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-delete-macthing-lines/m-p/2702791#M901856</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-04-12T15:55:33Z</dc:date>
    </item>
  </channel>
</rss>

