<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Idiomatic awk</title>
	<atom:link href="http://backreference.org/2010/02/10/idiomatic-awk/feed/" rel="self" type="application/rss+xml" />
	<link>http://backreference.org/2010/02/10/idiomatic-awk/</link>
	<description>Capture and remember</description>
	<lastBuildDate>Fri, 03 Feb 2012 08:42:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: waldner</title>
		<link>http://backreference.org/2010/02/10/idiomatic-awk/comment-page-1/#comment-24651</link>
		<dc:creator>waldner</dc:creator>
		<pubDate>Mon, 13 Jun 2011 16:10:25 +0000</pubDate>
		<guid isPermaLink="false">http://backreference.org/?p=825#comment-24651</guid>
		<description>I assume you want to print the lines that appear in all five files (or N files, for that matter). This should do it, assuming no file is empty (a bit reformatted for readability, but can be written all on a single line):

&lt;pre&gt;awk &#039;BEGIN{
  for(i = 1; i&lt;ARGC; i++){
    ref = ref s i
    s = &quot;.&quot;
  }
} 
FNR == 1 {count++} 
{a[$0] = a[$0] sep[$0] count; sep[$0] = &quot;.&quot;}
a[$0] == ref&#039; file1 file2 file3 ... fileN&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I assume you want to print the lines that appear in all five files (or N files, for that matter). This should do it, assuming no file is empty (a bit reformatted for readability, but can be written all on a single line):</p>
<pre>awk 'BEGIN{
  for(i = 1; i&lt;ARGC; i++){
    ref = ref s i
    s = "."
  }
}
FNR == 1 {count++}
{a[$0] = a[$0] sep[$0] count; sep[$0] = "."}
a[$0] == ref' file1 file2 file3 ... fileN</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Murpholinox Peligro</title>
		<link>http://backreference.org/2010/02/10/idiomatic-awk/comment-page-1/#comment-24649</link>
		<dc:creator>Murpholinox Peligro</dc:creator>
		<pubDate>Sun, 12 Jun 2011 22:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://backreference.org/?p=825#comment-24649</guid>
		<description>there is a way to do this but with five files, instead of two?

# prints lines that are both in file1.txt and file2.txt (intersection)
$ awk &#039;NR == FNR{a[$0];next} $0 in a&#039; file1.txt file2.txt</description>
		<content:encoded><![CDATA[<p>there is a way to do this but with five files, instead of two?</p>
<p># prints lines that are both in file1.txt and file2.txt (intersection)<br />
$ awk 'NR == FNR{a[$0];next} $0 in a' file1.txt file2.txt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Idiomatic awk &#171; El blog de Fer</title>
		<link>http://backreference.org/2010/02/10/idiomatic-awk/comment-page-1/#comment-7029</link>
		<dc:creator>Idiomatic awk &#171; El blog de Fer</dc:creator>
		<pubDate>Tue, 30 Nov 2010 13:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://backreference.org/?p=825#comment-7029</guid>
		<description>[...] ﻿http://backreference.org/2010/02/10/idiomatic-awk/ [...]</description>
		<content:encoded><![CDATA[<p>[...] ﻿http://backreference.org/2010/02/10/idiomatic-awk/ [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

