<?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: Removing lines from one list from another list. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655804#M677157</link>
    <description>I didn't realize it was this simple:&lt;BR /&gt;&lt;BR /&gt;grep -v -f list1 list2</description>
    <pubDate>Thu, 01 Jul 2010 16:21:14 GMT</pubDate>
    <dc:creator>Patrick Ware_1</dc:creator>
    <dc:date>2010-07-01T16:21:14Z</dc:date>
    <item>
      <title>Removing lines from one list from another list.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655803#M677156</link>
      <description>&lt;!--!*#--&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I was wondering if there was an easy way to take lines from a single-column list, and remove them from a second single-column list. For example, I want to remove the contents of list 1 from list 2. How would I do this?&lt;BR /&gt;&lt;BR /&gt;Contents of list 1:&lt;BR /&gt;&lt;BR /&gt;server1a&lt;BR /&gt;server2b&lt;BR /&gt;server3c&lt;BR /&gt;server4a&lt;BR /&gt;server5qb&lt;BR /&gt;server6ocd&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Contents of list 2"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;server1a&lt;BR /&gt;server2b&lt;BR /&gt;server3c&lt;BR /&gt;server4a&lt;BR /&gt;server5qb&lt;BR /&gt;server6ocd&lt;BR /&gt;server7dgw&lt;BR /&gt;server8sg&lt;BR /&gt;server9be&lt;BR /&gt;server10zt&lt;BR /&gt;server11w&lt;BR /&gt;server12t&lt;BR /&gt;server13f</description>
      <pubDate>Thu, 01 Jul 2010 16:14:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655803#M677156</guid>
      <dc:creator>Patrick Ware_1</dc:creator>
      <dc:date>2010-07-01T16:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Removing lines from one list from another list.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655804#M677157</link>
      <description>I didn't realize it was this simple:&lt;BR /&gt;&lt;BR /&gt;grep -v -f list1 list2</description>
      <pubDate>Thu, 01 Jul 2010 16:21:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655804#M677157</guid>
      <dc:creator>Patrick Ware_1</dc:creator>
      <dc:date>2010-07-01T16:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Removing lines from one list from another list.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655805#M677158</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Assuming that the file contents are each sorted:&lt;BR /&gt;&lt;BR /&gt;# comm -13 file1 file2&lt;BR /&gt;&lt;BR /&gt;...prints the lines from file2 not present in file1.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 01 Jul 2010 16:23:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655805#M677158</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-01T16:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Removing lines from one list from another list.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655806#M677159</link>
      <description>TMF=/tmp/$$&lt;BR /&gt;sort list1 list2 | uniq -c | awk '$1&amp;lt;2 {print $2}' &amp;gt; $TMF&lt;BR /&gt;sort $TMF list1 | uniq -c | awk '$1&amp;lt;2 {print $2}'&lt;BR /&gt;rm $TMF&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Thu, 01 Jul 2010 16:23:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655806#M677159</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2010-07-01T16:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Removing lines from one list from another list.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655807#M677160</link>
      <description>&amp;gt;I didn't realize it was this simple: grep -v -f list1 list2&lt;BR /&gt;&lt;BR /&gt;Yes, provided your files don't have 10s of thousands of lines.&lt;BR /&gt;&lt;BR /&gt;Be careful you don't have substring matches that you don't want.&lt;BR /&gt;If server1 was in list1, it would remove server1a, server10zt, etc.&lt;BR /&gt;&lt;BR /&gt;You can add -x to prevent this, provided you don't have any extra columns in list2.&lt;BR /&gt;There you may want to use -w.</description>
      <pubDate>Fri, 02 Jul 2010 08:09:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/removing-lines-from-one-list-from-another-list/m-p/4655807#M677160</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-07-02T08:09:20Z</dc:date>
    </item>
  </channel>
</rss>

