<?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 Two Text Files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371898#M347435</link>
    <description>I am writting a script where I have to Campare two text files. &lt;BR /&gt;I have 3 text files named by s_list, s_list_new and dmg_file. where I have to compare s_list and s_list_new and whatever the unique values are in s_list I have to add that in the dmg_file. And the values they are only in s_list_new and not in s_list I have to delete that from dmg_file&lt;BR /&gt;&lt;BR /&gt;I have tried so many things, but diff, comm is not helping me because if i do comm it compares line by line and the value may not match line by line and with diff its not giving me exact output and I am thinking may be im not aware of different diff output formats.&lt;BR /&gt;for example if i do diff temp temp1 i get like this output and I dont want it. i just want thos unique values nothing else &lt;BR /&gt;&lt;BR /&gt;diff temp temp1&lt;BR /&gt;1,5d0&lt;BR /&gt;&amp;lt; a&lt;BR /&gt;&amp;lt; 1&lt;BR /&gt;&amp;lt; 2&lt;BR /&gt;&amp;lt; 3&lt;BR /&gt;&amp;lt; 4&lt;BR /&gt;11c6,9&lt;BR /&gt;&amp;lt; &lt;BR /&gt;---&lt;BR /&gt;&amp;gt; 10&lt;BR /&gt;&amp;gt; 11&lt;BR /&gt;&amp;gt; 12&lt;BR /&gt;&amp;gt; 13&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any Help Plz&lt;BR /&gt;I will appreciate the help&lt;BR /&gt;</description>
    <pubDate>Wed, 04 Mar 2009 22:03:20 GMT</pubDate>
    <dc:creator>pareshan</dc:creator>
    <dc:date>2009-03-04T22:03:20Z</dc:date>
    <item>
      <title>Comparing Two Text Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371898#M347435</link>
      <description>I am writting a script where I have to Campare two text files. &lt;BR /&gt;I have 3 text files named by s_list, s_list_new and dmg_file. where I have to compare s_list and s_list_new and whatever the unique values are in s_list I have to add that in the dmg_file. And the values they are only in s_list_new and not in s_list I have to delete that from dmg_file&lt;BR /&gt;&lt;BR /&gt;I have tried so many things, but diff, comm is not helping me because if i do comm it compares line by line and the value may not match line by line and with diff its not giving me exact output and I am thinking may be im not aware of different diff output formats.&lt;BR /&gt;for example if i do diff temp temp1 i get like this output and I dont want it. i just want thos unique values nothing else &lt;BR /&gt;&lt;BR /&gt;diff temp temp1&lt;BR /&gt;1,5d0&lt;BR /&gt;&amp;lt; a&lt;BR /&gt;&amp;lt; 1&lt;BR /&gt;&amp;lt; 2&lt;BR /&gt;&amp;lt; 3&lt;BR /&gt;&amp;lt; 4&lt;BR /&gt;11c6,9&lt;BR /&gt;&amp;lt; &lt;BR /&gt;---&lt;BR /&gt;&amp;gt; 10&lt;BR /&gt;&amp;gt; 11&lt;BR /&gt;&amp;gt; 12&lt;BR /&gt;&amp;gt; 13&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any Help Plz&lt;BR /&gt;I will appreciate the help&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Mar 2009 22:03:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371898#M347435</guid>
      <dc:creator>pareshan</dc:creator>
      <dc:date>2009-03-04T22:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Two Text Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371899#M347436</link>
      <description>First "sort", then "diff"?</description>
      <pubDate>Wed, 04 Mar 2009 22:13:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371899#M347436</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-03-04T22:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Two Text Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371900#M347437</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You might find:&lt;BR /&gt;&lt;BR /&gt;# diff -c file1 file2&lt;BR /&gt;&lt;BR /&gt;...quite useful.  See the manpages for 'diff'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Mar 2009 22:14:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371900#M347437</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-04T22:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Two Text Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371901#M347438</link>
      <description>Use grep: &lt;BR /&gt;&lt;BR /&gt;grep -vf file1 file2&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Wed, 04 Mar 2009 23:24:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371901#M347438</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2009-03-04T23:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Two Text Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371902#M347439</link>
      <description>As Steven partially said, you need to use sort and comm(1).  My script will also sort dmg_file.&lt;BR /&gt;&lt;BR /&gt;# sort for comm&lt;BR /&gt;sort s_list &amp;gt; s_list.s&lt;BR /&gt;sort s_list_new &amp;gt; s_list_new.s&lt;BR /&gt;&lt;BR /&gt;# add unique stuff to dmg_file&lt;BR /&gt;comm -23 s_list.s s_list_new.s &amp;gt;&amp;gt; dmg_file&lt;BR /&gt;# get unique stuff to remove&lt;BR /&gt;comm -13 s_list.s s_list_new.s &amp;gt; dmg_file.r&lt;BR /&gt;&lt;BR /&gt;# sort for comm&lt;BR /&gt;sort dmg_file &amp;gt; dmg_file.s&lt;BR /&gt;# Remove stuff that was in s_list_new&lt;BR /&gt;comm -13 dmg_file.r dmg_file.s &amp;gt; dmg_file&lt;BR /&gt;# cleanup&lt;BR /&gt;rm -f s_list.s s_list_new.s dmg_file.[rs]&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Ivan: grep -vf file1 file2&lt;BR /&gt;&lt;BR /&gt;Caution about grep, you need to use -x and may need fgrep instead if comparing whole lines.</description>
      <pubDate>Thu, 05 Mar 2009 06:23:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371902#M347439</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-03-05T06:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Two Text Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371903#M347440</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can do this with a combination of commands "diff" and "comm". Please see the man page for both.&lt;BR /&gt;&lt;BR /&gt;Good luck&lt;BR /&gt;Shahul</description>
      <pubDate>Thu, 05 Mar 2009 15:26:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/comparing-two-text-files/m-p/4371903#M347440</guid>
      <dc:creator>Shahul</dc:creator>
      <dc:date>2009-03-05T15:26:50Z</dc:date>
    </item>
  </channel>
</rss>

