<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Extract the values using ids !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/43603/extract-the-values-using-ids?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/43603/extract-the-values-using-ids?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/43603/extract-the-values-using-ids</guid>
	<pubDate>Mon, 22 Nov 2021 20:07:29 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/43603/extract-the-values-using-ids</link>
	<title><![CDATA[Extract the values using ids !]]></title>
	<description><![CDATA[<code>#Awk script

awk &#039;NR==FNR{tgts[$1]; next} $1 in tgts&#039; file1 file2

Look:

$ cat file1
11002
10995
48981
79600
$ cat file2
10993   item    0
11002   item    6
10995   item    7
79600   item    7
439481  item    5
272557  item    7
224325  item    7
84156   item    6
572546  item    7
693661  item    7
$ awk &#039;NR==FNR{tgts[$1]; next} $1 in tgts&#039; file1 file2
11002   item    6
10995   item    7
79600   item    7</code>]]></description>
	<dc:creator>Surabhi Chaudhary</dc:creator>
</item>
<item>
	<guid isPermaLink='true'>https://bioinformaticsonline.com/snippets/view/43603/extract-the-values-using-ids#item-annotation-4014</guid>
	<pubDate>Mon, 22 Nov 2021 20:09:18 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/43603/extract-the-values-using-ids#item-annotation-4014</link>
	<title><![CDATA[Comment by Surabhi Chaudhary]]></title>
	<description><![CDATA[<p>Join could be also useful</p>
<pre><code>linux_prompt&gt; <span>join</span> file1 file2
<span>11002</span> item <span>6</span>
<span>10995</span> item <span>7</span>
<span>79600</span> item <span>7</span>
</code></pre>]]></description>
	<dc:creator>Surabhi Chaudhary</dc:creator>
</item>

</channel>
</rss>