<?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 comparing files - not sorted in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847568#M825451</link>
    <description>hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to compare two large files (hence trying bdiff), but I think I am asking for a bit too much. &lt;BR /&gt;&lt;BR /&gt;the files I want to compare are just a load of reference numbers, but the sorted nature of the file will mean I get an inaccurate picture, eg :&lt;BR /&gt;&lt;BR /&gt;file 1             file 2&lt;BR /&gt;------             ------&lt;BR /&gt;a1                 a1&lt;BR /&gt;b1                 b1&lt;BR /&gt;c1                 b2&lt;BR /&gt;d1                 c1&lt;BR /&gt;e1                 d1&lt;BR /&gt;                   e1&lt;BR /&gt;&lt;BR /&gt;I want to find out which records do not exist in the other negating the order. So if I use bdiff, four descrepancies will be flagged, when I only want to know about the fact that b2 exists in one file and not the other ... is this possible, am I asking too much. The actual files have 3 Million entries.&lt;BR /&gt;&lt;BR /&gt;thanks a lot&lt;BR /&gt;john</description>
    <pubDate>Tue, 19 Nov 2002 08:48:22 GMT</pubDate>
    <dc:creator>u856100</dc:creator>
    <dc:date>2002-11-19T08:48:22Z</dc:date>
    <item>
      <title>comparing files - not sorted</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847568#M825451</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to compare two large files (hence trying bdiff), but I think I am asking for a bit too much. &lt;BR /&gt;&lt;BR /&gt;the files I want to compare are just a load of reference numbers, but the sorted nature of the file will mean I get an inaccurate picture, eg :&lt;BR /&gt;&lt;BR /&gt;file 1             file 2&lt;BR /&gt;------             ------&lt;BR /&gt;a1                 a1&lt;BR /&gt;b1                 b1&lt;BR /&gt;c1                 b2&lt;BR /&gt;d1                 c1&lt;BR /&gt;e1                 d1&lt;BR /&gt;                   e1&lt;BR /&gt;&lt;BR /&gt;I want to find out which records do not exist in the other negating the order. So if I use bdiff, four descrepancies will be flagged, when I only want to know about the fact that b2 exists in one file and not the other ... is this possible, am I asking too much. The actual files have 3 Million entries.&lt;BR /&gt;&lt;BR /&gt;thanks a lot&lt;BR /&gt;john</description>
      <pubDate>Tue, 19 Nov 2002 08:48:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847568#M825451</guid>
      <dc:creator>u856100</dc:creator>
      <dc:date>2002-11-19T08:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: comparing files - not sorted</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847569#M825452</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;3 million entries?  &lt;GRIN&gt;&lt;BR /&gt;I would start thinking of loading this stuff into a database, create the necessary indexes and query the database for the required results.&lt;BR /&gt;&lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.&lt;/GRIN&gt;</description>
      <pubDate>Tue, 19 Nov 2002 08:51:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847569#M825452</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2002-11-19T08:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: comparing files - not sorted</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847570#M825453</link>
      <description>perl using a tied hash.&lt;BR /&gt;&lt;BR /&gt;warning, not tested.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;&lt;BR /&gt;use DB_File;&lt;BR /&gt;tie my %f1, "DB_File", "f1_tie";&lt;BR /&gt;@ARGV = ("f1");&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt; chomp;&lt;BR /&gt; $f1{$_}++;&lt;BR /&gt; }&lt;BR /&gt;@ARGV = ("f2");&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt; chomp;&lt;BR /&gt; if (exists $f1{$_}) {&lt;BR /&gt;  print "= $_ $f1{$_}\n";&lt;BR /&gt;  $f1{$_} = 0;&lt;BR /&gt;  }&lt;BR /&gt; else {&lt;BR /&gt;  print "&amp;gt; $_\n";&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt;for(keys%f1) {&lt;BR /&gt; $f1{$_} or next;&lt;BR /&gt; print "&amp;lt; $_ $f1{$_}\n";&lt;BR /&gt; }&lt;BR /&gt;untie %f1;</description>
      <pubDate>Tue, 19 Nov 2002 09:17:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847570#M825453</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-11-19T09:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: comparing files - not sorted</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847571#M825454</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you do a unique sort of both files, 'comm' will tell you which records only appear in one file and not the other.&lt;BR /&gt;&lt;BR /&gt;man comm&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Tue, 19 Nov 2002 09:31:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847571#M825454</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-11-19T09:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: comparing files - not sorted</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847572#M825455</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;I've just tried a quick test using &lt;BR /&gt;&lt;BR /&gt;file1    file2&lt;BR /&gt;-----    -----&lt;BR /&gt;a         c&lt;BR /&gt;b         d&lt;BR /&gt;c         b&lt;BR /&gt;          a&lt;BR /&gt;          a&lt;BR /&gt;&lt;BR /&gt;when I do $comm -12 file1 file2&lt;BR /&gt;&lt;BR /&gt;it gives me:     c&lt;BR /&gt;&lt;BR /&gt;But obviously a,b,and c appear in both files&lt;BR /&gt;&lt;BR /&gt;bit confused!&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;John&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Nov 2002 11:05:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847572#M825455</guid>
      <dc:creator>u856100</dc:creator>
      <dc:date>2002-11-19T11:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: comparing files - not sorted</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847573#M825456</link>
      <description>As stated in the man page, both files should be sorted, yours are not!&lt;BR /&gt;&lt;BR /&gt;If you sort your example files, then run comm -12, you'll get the correct answer (b and c, a isn't in your second file!).&lt;BR /&gt;&lt;BR /&gt;Actually, from your original post, you should be using comm -23 to list records in file1 and not file2.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Nov 2002 11:27:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-files-not-sorted/m-p/2847573#M825456</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-11-19T11:27:57Z</dc:date>
    </item>
  </channel>
</rss>

