<?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: Match two files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/match-two-files/m-p/5614629#M640488</link>
    <description>&lt;P&gt;You can simply use: fgrep -f file1 file2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you are worried about substrings in file1 that may match multiple lines in file2, you can add -w:&lt;/P&gt;&lt;P&gt;grep -w -f file1 file2&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2012 22:43:38 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2012-04-10T22:43:38Z</dc:date>
    <item>
      <title>Match two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/match-two-files/m-p/5613711#M640487</link>
      <description>&lt;P&gt;I have two files , the content is as below , I would like to list the lines in file2 , that the lines the file1 have , as the below , both files have aaaa , cccc , eeee , so the output is the line which have aaaa , cccc , eeee , can advise what can i do ? thx&lt;BR /&gt;&lt;BR /&gt;file1&lt;BR /&gt;=====&lt;BR /&gt;aaaa&lt;BR /&gt;bbbb&lt;BR /&gt;cccc&lt;BR /&gt;dddd&lt;BR /&gt;eeee&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;file2&lt;BR /&gt;=====&lt;BR /&gt;aaaa 1111&lt;BR /&gt;cccc 2222&lt;BR /&gt;eeee 3333&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;my desired result is as below&lt;BR /&gt;=============================&lt;BR /&gt;aaaa 1111&lt;BR /&gt;cccc 2222&lt;BR /&gt;eeee 3333&lt;!--   google_ad_section_end   --&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 06:09:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/match-two-files/m-p/5613711#M640487</guid>
      <dc:creator>Intothenewworld</dc:creator>
      <dc:date>2012-04-10T06:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Match two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/match-two-files/m-p/5614629#M640488</link>
      <description>&lt;P&gt;You can simply use: fgrep -f file1 file2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you are worried about substrings in file1 that may match multiple lines in file2, you can add -w:&lt;/P&gt;&lt;P&gt;grep -w -f file1 file2&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 22:43:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/match-two-files/m-p/5614629#M640488</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2012-04-10T22:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Match two files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/match-two-files/m-p/5614857#M640489</link>
      <description>&lt;P&gt;Hi There, you can try this with awk:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ awk 'NR==FNR {a[$1]=$1;next} {print a[$1],$2}' file1 file2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Raj D.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 05:01:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/match-two-files/m-p/5614857#M640489</guid>
      <dc:creator>RAJD1</dc:creator>
      <dc:date>2012-04-11T05:01:14Z</dc:date>
    </item>
  </channel>
</rss>

