<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Awk on Raveen Kumar</title>
    <link>https://raveenkumar.com/tags/awk/</link>
    <description>Recent content in Awk on Raveen Kumar</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>Raveen Kumar</copyright>
    <lastBuildDate>Sat, 18 Feb 2023 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://raveenkumar.com/tags/awk/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>AWK</title>
      <link>https://raveenkumar.com/library/programming/awk/</link>
      <pubDate>Sat, 18 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://raveenkumar.com/library/programming/awk/</guid>
      <description>&lt;h2 id=&#34;example-1&#34;&gt;Example 1&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;awk -F &#39;,&#39; &#39;{print $NF}&#39; {{filename}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To print only rows with columns matching a specific string&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;awk &#39;$3 == &amp;quot;hello&amp;quot;&#39; file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This will match with,&#xA;&lt;code&gt;1 2 hello something&lt;/code&gt;&#xA;but not with,&#xA;&lt;code&gt;1 2 world something&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;example-2-awking-and-cutting-some-stuff&#34;&gt;Example 2: Awking and cutting some stuff&lt;/h2&gt;&#xA;&lt;p&gt;Lets assume that you want to print the 1st and 3rd field in one line.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;echo &amp;quot;A:B:C:D:E:F:G&amp;quot; | awk -F &#39;:&#39; &#39;ORS=&amp;quot; &amp;quot; {print $1} {print $3}&#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Here ORS stands for, The output record separator, by default its a newline.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
