<?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: file comparing in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225666#M171122</link>
    <description>Actually, sdiff will already do this; it attempts to "resynchronize" to matching lines after listing inserted lines.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 22 Mar 2004 11:55:35 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2004-03-22T11:55:35Z</dc:date>
    <item>
      <title>file comparing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225663#M171119</link>
      <description>Hi&lt;BR /&gt; I need a way to compare two files and see the differences side by side not useing "sdiff" &lt;BR /&gt;</description>
      <pubDate>Mon, 22 Mar 2004 10:49:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225663#M171119</guid>
      <dc:creator>koby aharon_2</dc:creator>
      <dc:date>2004-03-22T10:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: file comparing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225664#M171120</link>
      <description>It would help to know what you are trying to do that sdiff does not already do.&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Mar 2004 10:52:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225664#M171120</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-03-22T10:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: file comparing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225665#M171121</link>
      <description>i need to compare two files find if there is a differences and build a table&lt;BR /&gt;&lt;BR /&gt;group|New|Old&lt;BR /&gt;&lt;BR /&gt;sdiff only compare lines side by side. if i add a line to one of the files that will move the lines compared to the other file i will get that the line do not match.</description>
      <pubDate>Mon, 22 Mar 2004 11:00:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225665#M171121</guid>
      <dc:creator>koby aharon_2</dc:creator>
      <dc:date>2004-03-22T11:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: file comparing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225666#M171122</link>
      <description>Actually, sdiff will already do this; it attempts to "resynchronize" to matching lines after listing inserted lines.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Mar 2004 11:55:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225666#M171122</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-03-22T11:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: file comparing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225667#M171123</link>
      <description>[this reply is also appended as text file to preserve spacing]&lt;BR /&gt;&lt;BR /&gt;I think I can sympathize with the basic request, but a&lt;BR /&gt;little more information is needed to help define an answer.&lt;BR /&gt;Let me answer through a counter-example.&lt;BR /&gt;&lt;BR /&gt;I while ago felt the need to compare two SAP 'R3.out' files&lt;BR /&gt;from rather different SAP systems. So there were going to be a bunch&lt;BR /&gt;of known differences. Too much for standard tools to be useful.&lt;BR /&gt;&lt;BR /&gt;So my script started out by recognizing the key difference:&lt;BR /&gt;'SAP system name' and 'Instance name'. In the partial data sample &lt;BR /&gt;below those were 'XXX' and 'Dnn'. Data value with this strings&lt;BR /&gt;were all replaced by a generic {SID} and {INST} strings before comparing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There were also missing lines to deal will, similar to the 'resync' that&lt;BR /&gt;sdiff does as mentioned in an earlier reply.&lt;BR /&gt;I did have one powerful bit of knowledge... the params were sorted by name.&lt;BR /&gt;So I could read left, read right in general but read more rights if &lt;BR /&gt;left became too high or read more lefts if the right seemed to escape&lt;BR /&gt;&lt;BR /&gt;I also wanted the report as name/left/right &lt;BR /&gt;much similar to the group/old/new requested.&lt;BR /&gt;Here is some sample input (modfied to protect the innocent :-):&lt;BR /&gt;&lt;BR /&gt;rslg/send_daemon/autostart             0&lt;BR /&gt;rslg/send_daemon/exe_file              /usr/sap/XXX/SYS/exe/run/rslgsend&lt;BR /&gt;rslg/send_daemon/listen_port       (!) 3700&lt;BR /&gt;rslg/send_daemon/pid_file              /usr/sap/XXX/Dnn/data/rslgspid&lt;BR /&gt;rslg/send_daemon/status_file           /usr/sap/XXX/Dnn/data/rslgssta&lt;BR /&gt;rslg/send_daemon/talk_port         (!) 1300&lt;BR /&gt;&lt;BR /&gt;Here is some sample output from my script:&lt;BR /&gt;&lt;BR /&gt;Parameter                        XXX - Dnn              YYY - D02&lt;BR /&gt;------------------------------ ? -------------------- ? --------------------&lt;BR /&gt;DIR_CLIENT_ORAHOME             | /oracle/{SID}        X /oracle/{SID}/901_64&lt;BR /&gt;DIR_ORAHOME                    | /oracle/{SID}        X /oracle/{SID}/901_64&lt;BR /&gt;DIR_SERVER_ORAHOME             | /oracle/{SID}        X /oracle/{SID}/901_64&lt;BR /&gt;ES/SHM_MAX_PRIV_SEGS           X 63                   | 2&lt;BR /&gt;ES/SHM_PROC_SEG_COUNT          X 64                   | 3&lt;BR /&gt;ES/TABLE                       X SHM_SEGS             | UNIX_STD&lt;BR /&gt;:&lt;BR /&gt;rslg/send_daemon/listen_port   X 3700                 X 3702&lt;BR /&gt;rslg/send_daemon/talk_port     X 1300                 X 1302&lt;BR /&gt;&lt;BR /&gt;So the lines with 'port' got picked up, but the lines with 'pid_file' were &lt;BR /&gt;not because they were logically equal&lt;BR /&gt;&lt;BR /&gt;And below is the script. Maybe it is enough to get you going.&lt;BR /&gt;Perhpas enough even to solve your problem (unlikely), &lt;BR /&gt;but hopefully at least enough to make you ask the right question!&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/perl&lt;BR /&gt;# }&lt;BR /&gt;$f1 = @ARGV[0];&lt;BR /&gt;$f2 = @ARGV[1];&lt;BR /&gt;$ALL = @ARGV[2];SAP System\s+(\w+)\s/);&lt;BR /&gt;die "Must provide two R3.out files to compare" unless $f2;&lt;BR /&gt;open (F1, $f1) || die "Error open file 1: $f1";&lt;BR /&gt;open (F2, $f2) || die "Error open file 2: $f2";&lt;BR /&gt;&lt;BR /&gt;# Find system ID and first parameter&lt;BR /&gt;# (also pick up SAPLOCALHOST? )&lt;BR /&gt;while (&lt;F1&gt;) {&lt;BR /&gt;  $S1 = $1 if (/SAP System\s+(\w+)\s/);&lt;BR /&gt;  $I1 = $1 if (/^INSTANCE_NAME\s+\(!\) (\w+)/);&lt;BR /&gt;  last if (/^Param/);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;while (&lt;F2&gt;) {&lt;BR /&gt;  $S2 = $1 if (/SAP System\s+(\w+)\s/);&lt;BR /&gt;  $I2 = $1 if (/^INSTANCE_NAME\s+\(!\) (\w+)/);&lt;BR /&gt;  last if (/^Param/);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;$format = "%-30.30s %s %-20s %s %-20s\n";&lt;BR /&gt;print "\nColumn \"?\" legend: \"|\" = default, \"X\" = changed, \" \" = missing.\n\n";&lt;BR /&gt;printf $format, "Parameter", " ", "$S1 - $I1", " ", "$S2 - $I2";&lt;BR /&gt;printf $format, "------------------------------","?","--------------------",&lt;BR /&gt;                            "?","--------------------";&lt;BR /&gt;while (&lt;F1&gt;) {&lt;BR /&gt;  $v1 = " ";&lt;BR /&gt;  if (/^(\S+).*(   |\(!\)) (.{1,20})/) {&lt;BR /&gt;    $k1 = $1;&lt;BR /&gt;    $d1 = ($2 eq "   ") ? "|" : "X";&lt;BR /&gt;    $v1 = $3;&lt;BR /&gt;    $v1 =~ s/$S1/{SID}/g;&lt;BR /&gt;    $v1 =~ s/$I1/{INST}/g;&lt;BR /&gt;    }&lt;BR /&gt;  while ($k2 lt $k1) {&lt;BR /&gt;    last unless ($_ = &lt;F2&gt;);&lt;BR /&gt;    $v2 = " ";&lt;BR /&gt;    if (/^(\S+).*(   |\(!\)) (.{1,20})/) {&lt;BR /&gt;      $k2 = $1;&lt;BR /&gt;      $d2 = ($2 eq "   ") ? "|" : "X";&lt;BR /&gt;      $v2 = $3;&lt;BR /&gt;      $v2 =~ s/$S2/{SID}/g;&lt;BR /&gt;      $v2 =~ s/$I2/{INST}/g;&lt;BR /&gt;      }&lt;BR /&gt;    if ($k2 lt $k1) {&lt;BR /&gt;      printf $format, $k2, " ", " ", $d2, $v2;&lt;BR /&gt;      }&lt;BR /&gt;    }&lt;BR /&gt;  if ($k1 eq $k2) {&lt;BR /&gt;    printf $format, $k1, $d1, $v1, $d2, $v2 if&lt;BR /&gt;#     ($ALL eq "all" || ($v1 ne $v2 &amp;amp;&amp;amp; (($d1.$d2 ne "||")||($ALL eq "more")));&lt;BR /&gt;#     ($ALL || ($v1 ne $v2 &amp;amp;&amp;amp; ($d1.$d2 ne "||") ) );&lt;BR /&gt;      ($ALL || ($v1 ne $v2) );&lt;BR /&gt;    } else {&lt;BR /&gt;    printf $format, $k1, $d1, $v1, " ", " ";&lt;BR /&gt;    }&lt;BR /&gt;  }&lt;BR /&gt;&lt;/F2&gt;&lt;/F1&gt;&lt;/F2&gt;&lt;/F1&gt;</description>
      <pubDate>Mon, 22 Mar 2004 14:37:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225667#M171123</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-03-22T14:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: file comparing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225668#M171124</link>
      <description>You might want to look at the 'comm' command.&lt;BR /&gt;&lt;BR /&gt;$man comm&lt;BR /&gt;&lt;BR /&gt;DESCRIPTION&lt;BR /&gt;      comm reads file1 and file2, which should be ordered in increasing collating sequence (see sort(1) and Environment Variables below), and produces a three-column output:&lt;BR /&gt; &lt;BR /&gt;           Column 1:   Lines that appear only in file1,&lt;BR /&gt;           Column 2:   Lines that appear only in file2,&lt;BR /&gt;           Column 3:   Lines that appear in both files.&lt;BR /&gt; &lt;BR /&gt;      If - is used for file1 or file2, the standard input is used.&lt;BR /&gt; &lt;BR /&gt;      Options 1, 2, or 3 suppress printing of the corresponding column.  Thus comm -12 prints only the lines common to the two files; comm -23 prints only lines in the first file but not in the second; comm -123      does nothing useful.</description>
      <pubDate>Mon, 22 Mar 2004 15:11:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-comparing/m-p/3225668#M171124</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2004-03-22T15:11:53Z</dc:date>
    </item>
  </channel>
</rss>

