<?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: comparing 2 files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135169#M153873</link>
    <description>Hi John&lt;BR /&gt;&lt;BR /&gt;your sugestion didnÂ´t work. If you see the attachment that I sent, you will understand why.&lt;BR /&gt;&lt;BR /&gt;tks&lt;BR /&gt;Marc</description>
    <pubDate>Thu, 04 Dec 2003 07:29:25 GMT</pubDate>
    <dc:creator>Marcia Ferreira</dc:creator>
    <dc:date>2003-12-04T07:29:25Z</dc:date>
    <item>
      <title>comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135154#M153858</link>
      <description>Hi people&lt;BR /&gt;&lt;BR /&gt;I have 2 files: t1 and t2 - both of them has a list of disk devices. I intend to compare both and extract de difference. The problem is diff and comm, compare lines, and I want to compare all the differences.&lt;BR /&gt;Does somebody know how can I compare those files?&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Marcia Ferreira</description>
      <pubDate>Wed, 03 Dec 2003 12:11:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135154#M153858</guid>
      <dc:creator>Marcia Ferreira</dc:creator>
      <dc:date>2003-12-03T12:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135155#M153859</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Asumming that files are sorted before, both tools could do it. Else you can give us some line of both files to check format.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 03 Dec 2003 12:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135155#M153859</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-12-03T12:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135156#M153860</link>
      <description>have you tried using sdiff?</description>
      <pubDate>Wed, 03 Dec 2003 12:17:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135156#M153860</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-12-03T12:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135157#M153861</link>
      <description>Hi Marcia,&lt;BR /&gt;&lt;BR /&gt;what do you mean by all the differences? Sort the two file as mentioned before and diff should work. Can you explain a bit more, what differences you mean?&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Dec 2003 12:21:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135157#M153861</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-03T12:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135158#M153862</link>
      <description>sdiff -s -w [len] file1 file 2 |pg&lt;BR /&gt;&lt;BR /&gt;where [len] is the length of the longest line in either file +1.  The -s option tells sdiff to not display lines that are exactly alike.  Differeneces in whitepspace (spaces or tabs) are counted as a valid difference.&lt;BR /&gt;&lt;BR /&gt;mark</description>
      <pubDate>Wed, 03 Dec 2003 12:27:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135158#M153862</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2003-12-03T12:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135159#M153863</link>
      <description>Hi&lt;BR /&gt;      Considering that the file t1 and t2 has got the device names sorted by unique key ( sort -u ) and you can also use with -c option to see there are no lines with duplicate keys in addition to checking that input file is sorted and the to a diff netween them will suffice your request .&lt;BR /&gt;&lt;BR /&gt;Sathish C&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Dec 2003 02:03:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135159#M153863</guid>
      <dc:creator>Sathish C</dc:creator>
      <dc:date>2003-12-04T02:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135160#M153864</link>
      <description>Hi guys&lt;BR /&gt;&lt;BR /&gt;the problem is t1 has 26 lines, and has  disks device. t1 has 27 lines and has disk device too. There are some common devices; I want to create a new file e.g t3, that will have only the different disk devices. When I use diff, comm or sdiff, they compare line to line, not line to file.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Marcia</description>
      <pubDate>Thu, 04 Dec 2003 07:04:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135160#M153864</guid>
      <dc:creator>Marcia Ferreira</dc:creator>
      <dc:date>2003-12-04T07:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135161#M153865</link>
      <description>hi&lt;BR /&gt;      that was exactly what almost everyone sujjested to you , sort the file&lt;BR /&gt;&lt;BR /&gt;sort -u t1 &amp;gt; t1.s&lt;BR /&gt;sort -u t2 &amp;gt; t2.s&lt;BR /&gt;diff t1.s t2.s&lt;BR /&gt;&lt;BR /&gt;should give you the result .&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Dec 2003 07:07:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135161#M153865</guid>
      <dc:creator>Sathish C</dc:creator>
      <dc:date>2003-12-04T07:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135162#M153866</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm very sorry, but comm *can* do it if files are sorted first, or you forgot to tell us something about your files. Give us some lines of both or try sort then comm.&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Thu, 04 Dec 2003 07:09:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135162#M153866</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-12-04T07:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135163#M153867</link>
      <description>If that is what you want, it can be done like this:&lt;BR /&gt;&lt;BR /&gt;prev=&lt;BR /&gt;cat t1 t2 | sort -u | while read line&lt;BR /&gt;do&lt;BR /&gt;   if [ `grep -q "$line" t1 t2 | wc -l` -eq 1 ]&lt;BR /&gt;      echo $line &amp;gt;&amp;gt; t3&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Or with awk or perl, using the sorted output of both files. But this is the simplest solution I can think of right now.</description>
      <pubDate>Thu, 04 Dec 2003 07:12:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135163#M153867</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-12-04T07:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135164#M153868</link>
      <description>Problem with diff is that it will give more output then just the lines that are not in both files...&lt;BR /&gt;&lt;BR /&gt;(the prev= line in my solution is nonsense. Was a try that I ignored)</description>
      <pubDate>Thu, 04 Dec 2003 07:15:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135164#M153868</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-12-04T07:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135165#M153869</link>
      <description>Hi Jean&lt;BR /&gt;&lt;BR /&gt;I did sort -u first. I will send all the files to you understand what I want.&lt;BR /&gt;The scene is: I hae to create 2 VGs with sequencial disk devices, but I have others VG created on the server. I have to compare all the disk devices captured by ioscan, and compare with the PVs related to the VGs created. The free disk devices will use to create a new VG. (t1 is the list of a VG had created and t2 is the list of ioscan)&lt;BR /&gt;&lt;BR /&gt;tks&lt;BR /&gt;&lt;BR /&gt;Marcia</description>
      <pubDate>Thu, 04 Dec 2003 07:18:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135165#M153869</guid>
      <dc:creator>Marcia Ferreira</dc:creator>
      <dc:date>2003-12-04T07:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135166#M153870</link>
      <description>Hi,&lt;BR /&gt;if you have two files  like this:&lt;BR /&gt;&lt;BR /&gt;# cat file1&lt;BR /&gt;fup1&lt;BR /&gt;fup2&lt;BR /&gt;fup3&lt;BR /&gt;fup4&lt;BR /&gt;fup5&lt;BR /&gt;&lt;BR /&gt;# cat file2&lt;BR /&gt;fup1&lt;BR /&gt;fup2&lt;BR /&gt;fup4&lt;BR /&gt;fup5&lt;BR /&gt;fup6&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# comm -3 file1 file2&lt;BR /&gt;fup3&lt;BR /&gt;        fup6&lt;BR /&gt; &lt;BR /&gt;Is that not what you want?&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Dec 2003 07:19:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135166#M153870</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-12-04T07:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135167#M153871</link>
      <description>Well, I am convinced that this is an overly complex way to do it but it is the first thing that came into my head and it does actually work.&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;open FILE1, "&lt;T1&gt;&lt;/T1&gt;open FILE2, "&lt;T2&gt;&lt;/T2&gt;&lt;BR /&gt;while($i=&lt;FILE1&gt;){&lt;BR /&gt;        chomp($i);&lt;BR /&gt;        $LIST{$i}++;&lt;BR /&gt;        &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;while($i=&lt;FILE2&gt;){&lt;BR /&gt;        chomp($i);&lt;BR /&gt;        $LIST{$i}++&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;foreach $i (keys %LIST){&lt;BR /&gt;        if($LIST{$i} == 1){&lt;BR /&gt;                print "$i\n";&lt;BR /&gt;        }&lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;I am sure there are a lot quicker and more sensible ways this can be done&lt;/FILE2&gt;&lt;/FILE1&gt;</description>
      <pubDate>Thu, 04 Dec 2003 07:22:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135167#M153871</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-04T07:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135168#M153872</link>
      <description>Wow Jon!&lt;BR /&gt; &lt;BR /&gt;I had never even heard of the "comm" command.  Looks good to me though :)</description>
      <pubDate>Thu, 04 Dec 2003 07:24:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135168#M153872</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-04T07:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135169#M153873</link>
      <description>Hi John&lt;BR /&gt;&lt;BR /&gt;your sugestion didnÂ´t work. If you see the attachment that I sent, you will understand why.&lt;BR /&gt;&lt;BR /&gt;tks&lt;BR /&gt;Marc</description>
      <pubDate>Thu, 04 Dec 2003 07:29:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135169#M153873</guid>
      <dc:creator>Marcia Ferreira</dc:creator>
      <dc:date>2003-12-04T07:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135170#M153874</link>
      <description>I think you need to re-create one of the files: one uses the block devices, while the other one uses the raw devices !!!&lt;BR /&gt;&lt;BR /&gt;Or you could use cut to get only the device name and ignore the first 2 parts of the device path:&lt;BR /&gt;cut -d/ -f4&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Dec 2003 07:31:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135170#M153874</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-12-04T07:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135171#M153875</link>
      <description>Hi again,&lt;BR /&gt;actually, I did not see your attachment before I posted. Therefore I did not understand that the issue was comparing disk devices with raw devices. &lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Thu, 04 Dec 2003 07:34:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135171#M153875</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-12-04T07:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135172#M153876</link>
      <description>Hi again,&lt;BR /&gt;how about:&lt;BR /&gt;# cat t1| awk -F/ '{print $4}  &amp;gt; t1.lim &lt;BR /&gt;# cat t2| awk -F/ '{print $4} &amp;gt; t2.lim&lt;BR /&gt;&lt;BR /&gt;The way it was in the detachment caused it to be $4, the idea is to have only the last parts of each line in the files. Then&lt;BR /&gt;# comm -3 t1.lim t2.lim&lt;BR /&gt;        c19t0d0&lt;BR /&gt;        c19t13d6&lt;BR /&gt;        c19t13d7&lt;BR /&gt;        c19t14d0&lt;BR /&gt;        c19t14d1&lt;BR /&gt;        c19t14d6&lt;BR /&gt;        c19t14d7&lt;BR /&gt;        c19t2d0&lt;BR /&gt;        c19t3d0&lt;BR /&gt;        c19t4d0&lt;BR /&gt;        c19t8d0&lt;BR /&gt;        c19t8d1&lt;BR /&gt;        c19t8d2&lt;BR /&gt;        c19t8d3&lt;BR /&gt;c21t12d0&lt;BR /&gt;c21t12d1&lt;BR /&gt;c21t12d2&lt;BR /&gt;c21t12d3&lt;BR /&gt;c21t12d4&lt;BR /&gt;c21t12d5&lt;BR /&gt;c21t12d6&lt;BR /&gt;c21t12d7&lt;BR /&gt;c21t13d0&lt;BR /&gt;c21t13d1&lt;BR /&gt;c21t13d2&lt;BR /&gt;c21t13d3&lt;BR /&gt;c21t13d4&lt;BR /&gt; &lt;BR /&gt;will that do for at starting point?&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Dec 2003 07:43:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135172#M153876</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-12-04T07:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: comparing 2 files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135173#M153877</link>
      <description>Hi John&lt;BR /&gt;&lt;BR /&gt;sorry, but I sent the wrong file. My partner save another file with the same name.&lt;BR /&gt;Your solution was right. The problem finished.&lt;BR /&gt;&lt;BR /&gt;thanks a lot&lt;BR /&gt;&lt;BR /&gt;Marcia&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Dec 2003 07:47:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-2-files/m-p/3135173#M153877</guid>
      <dc:creator>Marcia Ferreira</dc:creator>
      <dc:date>2003-12-04T07:47:51Z</dc:date>
    </item>
  </channel>
</rss>

