<?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: Script help needed in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058703#M93952</link>
    <description>Awesome.  Thanks everyone!!!</description>
    <pubDate>Tue, 17 Jul 2007 20:32:21 GMT</pubDate>
    <dc:creator>TheJuiceman</dc:creator>
    <dc:date>2007-07-17T20:32:21Z</dc:date>
    <item>
      <title>Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058699#M93948</link>
      <description>Hey gang,&lt;BR /&gt;This is an easy one, but for some reason it escapes me.  This is what I need to do...&lt;BR /&gt;&lt;BR /&gt;I have FileA that has a long list of miscellaneous entries&lt;BR /&gt;&lt;BR /&gt;I have FileB that has a partial list of what FileA has in it.&lt;BR /&gt;&lt;BR /&gt;I need to create FileC that has what is in FileA less FileB.  How is the best way to pull this off?  Thanks again.</description>
      <pubDate>Tue, 17 Jul 2007 17:53:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058699#M93948</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2007-07-17T17:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058700#M93949</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If the files are sorted (or can be) then you can use 'comm' [see its manpages]:&lt;BR /&gt;&lt;BR /&gt;# comm -23 fileA fileB &amp;gt; fileC&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 17 Jul 2007 18:10:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058700#M93949</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-07-17T18:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058701#M93950</link>
      <description>cat FileA | grep -vf FileB &amp;gt; FileC&lt;BR /&gt;&lt;BR /&gt;Regds,&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Tue, 17 Jul 2007 18:13:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058701#M93950</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2007-07-17T18:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058702#M93951</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;...and if for whatever reason your files are not sorted or cannot be sorted, use:&lt;BR /&gt;&lt;BR /&gt;# cat ./filter&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my $fileA = shift or die "Usage: FileA FileA\n";&lt;BR /&gt;my $fileB = shift or die "Usage: FileA FileB\n";&lt;BR /&gt;my %line;&lt;BR /&gt;my @list;&lt;BR /&gt;&lt;BR /&gt;open( FH, "&amp;lt;", $fileB ) or die "Can't open $fileB: $!\n";&lt;BR /&gt;while (&lt;FH&gt;) {&lt;BR /&gt;    $line{$_}++;&lt;BR /&gt;}&lt;BR /&gt;close FH;&lt;BR /&gt;open( FH, "&amp;lt;", $fileA ) or die "Can't open $fileA: $!\n";&lt;BR /&gt;while (&lt;FH&gt;) {&lt;BR /&gt;    push @list, $_ unless exists $line{$_};&lt;BR /&gt;}&lt;BR /&gt;print for @list;&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./filter fileA fileB&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/FH&gt;&lt;/FH&gt;</description>
      <pubDate>Tue, 17 Jul 2007 19:01:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058702#M93951</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-07-17T19:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058703#M93952</link>
      <description>Awesome.  Thanks everyone!!!</description>
      <pubDate>Tue, 17 Jul 2007 20:32:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058703#M93952</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2007-07-17T20:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058704#M93953</link>
      <description>&amp;gt;Kaps01: cat FileA | grep -vf FileB &amp;gt; FileC&lt;BR /&gt;&lt;BR /&gt;No need to use cat:&lt;BR /&gt;$ grep -vf FileB FileA &amp;gt; FileC&lt;BR /&gt;&lt;BR /&gt;You'll have bad performance if the number of lines in FileB and FileA are very large.&lt;BR /&gt;&lt;BR /&gt;A caution about grep, if FileB has lines are substrings of other lines in FileA, you'll miss them.  You can fix this with grep -x.</description>
      <pubDate>Tue, 17 Jul 2007 22:14:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-help-needed/m-p/5058704#M93953</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-17T22:14:58Z</dc:date>
    </item>
  </channel>
</rss>

