<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>The UNIX School</title><link>http://www.theunixschool.com/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/http/unix-schoolblogspotcom" /><description>Instructions/Tutorials on Unix/Linux commands, C Programming, Unix Administration , Oracle, PL SQL, Perl, Productivity tips soft skills for newbies and professionals.</description><language>en</language><managingEditor>noreply@blogger.com (Guru Prasad)</managingEditor><lastBuildDate>Tue, 18 Jun 2013 18:15:38 PDT</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">160</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">25</openSearch:itemsPerPage><feedburner:info uri="http/unix-schoolblogspotcom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:owner><itunes:email>guru@theunixschool.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:subtitle>Instructions/Tutorials on Unix/Linux commands, C Programming, Unix Administration , Oracle, PL SQL, Perl, Productivity tips soft skills for newbies and professionals.</itunes:subtitle><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.0/</creativeCommons:license><feedburner:emailServiceId>http/unix-schoolblogspotcom</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Perl : Remove duplicate elements from arrays</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/sP2w9OMcT_w/perl-remove-duplicate-elements-from.html</link><category>perl arrays</category><category>Perl</category><category>remove duplicates</category><author>guru@theunixschool.com</author><pubDate>Mon, 13 May 2013 22:18:34 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-7024827363412366721</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-14T10:48:34.985+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to remove duplicate element from arrays in Perl? Let us see in this article how can duplicates be removed in different ways?



1. Copying distinct elements to new array using grep function:

my...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=sP2w9OMcT_w:HXAF4LL8dhI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=sP2w9OMcT_w:HXAF4LL8dhI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=sP2w9OMcT_w:HXAF4LL8dhI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=sP2w9OMcT_w:HXAF4LL8dhI:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=sP2w9OMcT_w:HXAF4LL8dhI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=sP2w9OMcT_w:HXAF4LL8dhI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=sP2w9OMcT_w:HXAF4LL8dhI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=sP2w9OMcT_w:HXAF4LL8dhI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=sP2w9OMcT_w:HXAF4LL8dhI:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=sP2w9OMcT_w:HXAF4LL8dhI:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=sP2w9OMcT_w:HXAF4LL8dhI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/05/perl-remove-duplicate-elements-from.html</feedburner:origLink></item><item><title>Perl - 6 examples to fetch date / time without Linux date command</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/WlpSr8mC6uQ/perl-6-examples-to-fetch-date-time.html</link><category>perl date</category><category>date functions</category><category>linux date command</category><category>date</category><author>guru@theunixschool.com</author><pubDate>Wed, 10 Apr 2013 04:01:32 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-1224716880713739451</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-10T16:31:32.400+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to fetch date and time related stuff within in Perl?

&amp;nbsp; &amp;nbsp;Sometimes, Perl developers resort to using of Unix system date command to fetch a date or time within Perl script. This is not...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=WlpSr8mC6uQ:4EkAw36SoyA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=WlpSr8mC6uQ:4EkAw36SoyA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=WlpSr8mC6uQ:4EkAw36SoyA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=WlpSr8mC6uQ:4EkAw36SoyA:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=WlpSr8mC6uQ:4EkAw36SoyA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=WlpSr8mC6uQ:4EkAw36SoyA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=WlpSr8mC6uQ:4EkAw36SoyA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=WlpSr8mC6uQ:4EkAw36SoyA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=WlpSr8mC6uQ:4EkAw36SoyA:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=WlpSr8mC6uQ:4EkAw36SoyA:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=WlpSr8mC6uQ:4EkAw36SoyA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/04/perl-6-examples-to-fetch-date-time.html</feedburner:origLink></item><item><title>Perl - How to find the sum of digits in a number?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/nI_Zo29j-8w/perl-how-to-find-sum-of-digits-in-number.html</link><category>perl sum digits</category><category>Perl</category><author>guru@theunixschool.com</author><pubDate>Tue, 26 Mar 2013 03:40:22 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-4011818447518237462</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-26T16:10:22.608+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to find the sum of all the digits in a number or a string? OR How to find the sum of all elements in array? Let us see the different ways how it can be done in Perl?



1. Divide and...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=nI_Zo29j-8w:w-w7yYFD1gM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=nI_Zo29j-8w:w-w7yYFD1gM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=nI_Zo29j-8w:w-w7yYFD1gM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=nI_Zo29j-8w:w-w7yYFD1gM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=nI_Zo29j-8w:w-w7yYFD1gM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=nI_Zo29j-8w:w-w7yYFD1gM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=nI_Zo29j-8w:w-w7yYFD1gM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=nI_Zo29j-8w:w-w7yYFD1gM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=nI_Zo29j-8w:w-w7yYFD1gM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=nI_Zo29j-8w:w-w7yYFD1gM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=nI_Zo29j-8w:w-w7yYFD1gM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/03/perl-how-to-find-sum-of-digits-in-number.html</feedburner:origLink></item><item><title>How to remove leading zeros in a string in Linux?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/fOxIc6sgNqM/how-to-remove-leading-zeros-in-string.html</link><category>ksh</category><category>perl one liners</category><category>awk one liners</category><category>remove leading zeros</category><author>guru@theunixschool.com</author><pubDate>Thu, 14 Mar 2013 03:43:39 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-2973515498960038714</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-14T16:13:39.799+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total><description>How to remove leading zeros in a variable or a string?



Let us consider a variable "x" which has the below value :

$ x=0010
$ echo $x
0010
1. Using typeset command of ksh:

$ typeset -LZ x
$...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=fOxIc6sgNqM:e_aTdTmyigg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=fOxIc6sgNqM:e_aTdTmyigg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=fOxIc6sgNqM:e_aTdTmyigg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=fOxIc6sgNqM:e_aTdTmyigg:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=fOxIc6sgNqM:e_aTdTmyigg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=fOxIc6sgNqM:e_aTdTmyigg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=fOxIc6sgNqM:e_aTdTmyigg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=fOxIc6sgNqM:e_aTdTmyigg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=fOxIc6sgNqM:e_aTdTmyigg:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=fOxIc6sgNqM:e_aTdTmyigg:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=fOxIc6sgNqM:e_aTdTmyigg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/03/how-to-remove-leading-zeros-in-string.html</feedburner:origLink></item><item><title>Perl - What is __DATA__ ?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/a9pgFjvluv0/perl-what-is-data.html</link><category>Perl</category><category>perl DATA handler</category><category>__END__</category><category>__DATA__</category><category>perl file handling</category><author>guru@theunixschool.com</author><pubDate>Tue, 26 Feb 2013 02:33:00 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-3253051547271287819</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-26T16:03:00.204+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>What is __DATA__ ? Why is it used?

&amp;nbsp; &amp;nbsp; Generally, Perl reads data from a file which in the Perl program can be accessed using open and readline functions. However, for users who just want...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=a9pgFjvluv0:3KZ5qcfD34c:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=a9pgFjvluv0:3KZ5qcfD34c:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=a9pgFjvluv0:3KZ5qcfD34c:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=a9pgFjvluv0:3KZ5qcfD34c:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=a9pgFjvluv0:3KZ5qcfD34c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=a9pgFjvluv0:3KZ5qcfD34c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=a9pgFjvluv0:3KZ5qcfD34c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=a9pgFjvluv0:3KZ5qcfD34c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=a9pgFjvluv0:3KZ5qcfD34c:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=a9pgFjvluv0:3KZ5qcfD34c:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=a9pgFjvluv0:3KZ5qcfD34c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/02/perl-what-is-data.html</feedburner:origLink></item><item><title>What is the time command in Linux for?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/6D4FmezwWgs/what-is-time-command-in-linux-for.html</link><category>time command</category><category>unix time</category><author>guru@theunixschool.com</author><pubDate>Tue, 19 Feb 2013 03:23:57 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-5051821723370299694</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-19T16:53:57.654+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>time command in Unix is used to find the time taken by a particular command to execute. This is very useful when we want to time a particular command or a particular script to know the amount of time...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6D4FmezwWgs:3TaJLFu2scY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6D4FmezwWgs:3TaJLFu2scY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=6D4FmezwWgs:3TaJLFu2scY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6D4FmezwWgs:3TaJLFu2scY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6D4FmezwWgs:3TaJLFu2scY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=6D4FmezwWgs:3TaJLFu2scY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6D4FmezwWgs:3TaJLFu2scY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=6D4FmezwWgs:3TaJLFu2scY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6D4FmezwWgs:3TaJLFu2scY:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=6D4FmezwWgs:3TaJLFu2scY:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6D4FmezwWgs:3TaJLFu2scY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/02/what-is-time-command-in-linux-for.html</feedburner:origLink></item><item><title>sed - 10 examples to replace / delete / print lines of CSV file</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/6ek_z5mkZeo/sed-examples-replace-delete-print-lines-csv-files.html</link><category>sed regular expression</category><category>parse CSV file</category><category>sed one liners</category><category>sed</category><author>guru@theunixschool.com</author><pubDate>Tue, 12 Feb 2013 02:55:07 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-7345296695259990364</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-12T16:25:07.109+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to use sed to work with a CSV file? Or How to work with any file in which fields are separated by a delimiter?



Let us consider a sample CSV file with the following content:

cat...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6ek_z5mkZeo:kGyGA4Q2t04:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6ek_z5mkZeo:kGyGA4Q2t04:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=6ek_z5mkZeo:kGyGA4Q2t04:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6ek_z5mkZeo:kGyGA4Q2t04:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6ek_z5mkZeo:kGyGA4Q2t04:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=6ek_z5mkZeo:kGyGA4Q2t04:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6ek_z5mkZeo:kGyGA4Q2t04:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=6ek_z5mkZeo:kGyGA4Q2t04:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6ek_z5mkZeo:kGyGA4Q2t04:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=6ek_z5mkZeo:kGyGA4Q2t04:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=6ek_z5mkZeo:kGyGA4Q2t04:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/02/sed-examples-replace-delete-print-lines-csv-files.html</feedburner:origLink></item><item><title>How to delete every nth line in a file in Linux?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/s3404L2D6zU/how-to-delete-every-nth-line-in-file-in.html</link><category>delete line</category><category>perl one liners</category><category>awk one liners</category><category>sed one liners</category><author>guru@theunixschool.com</author><pubDate>Wed, 06 Feb 2013 03:07:31 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-5762911412582864329</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-06T16:37:31.167+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to delete or remove every nth line in a file? The requirement is to remove every 3rd line in the file.



Let us consider a file with the below content.

$ cat...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s3404L2D6zU:QiSQLnVirsM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s3404L2D6zU:QiSQLnVirsM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=s3404L2D6zU:QiSQLnVirsM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s3404L2D6zU:QiSQLnVirsM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s3404L2D6zU:QiSQLnVirsM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=s3404L2D6zU:QiSQLnVirsM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s3404L2D6zU:QiSQLnVirsM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=s3404L2D6zU:QiSQLnVirsM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s3404L2D6zU:QiSQLnVirsM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=s3404L2D6zU:QiSQLnVirsM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s3404L2D6zU:QiSQLnVirsM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/02/how-to-delete-every-nth-line-in-file-in.html</feedburner:origLink></item><item><title>Perl - How to split a string into words?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/u5eT-qTJQrE/perl-how-to-split-string-into-words.html</link><category>Perl</category><category>perl qr</category><category>perl split string</category><category>perl regular expression</category><author>guru@theunixschool.com</author><pubDate>Tue, 05 Feb 2013 03:03:38 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-4741879102744285378</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-05T16:33:38.787+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to split a string into&amp;nbsp;individual&amp;nbsp;words? Let us see in this article how to split a string which has 2 words separated by spaces.



1. Using the split inbuilt function:

my $str="hi...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=u5eT-qTJQrE:IwQLafgD0tA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=u5eT-qTJQrE:IwQLafgD0tA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=u5eT-qTJQrE:IwQLafgD0tA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=u5eT-qTJQrE:IwQLafgD0tA:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=u5eT-qTJQrE:IwQLafgD0tA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=u5eT-qTJQrE:IwQLafgD0tA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=u5eT-qTJQrE:IwQLafgD0tA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=u5eT-qTJQrE:IwQLafgD0tA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=u5eT-qTJQrE:IwQLafgD0tA:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=u5eT-qTJQrE:IwQLafgD0tA:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=u5eT-qTJQrE:IwQLafgD0tA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/02/perl-how-to-split-string-into-words.html</feedburner:origLink></item><item><title>gawk - Calculate date / time difference between timestamps</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/dsT6nB6DrHM/gawk-calculate-date-time-difference-timestamp.html</link><category>gawk</category><category>awk date functions</category><category>awk time</category><category>time difference</category><author>guru@theunixschool.com</author><pubDate>Mon, 04 Feb 2013 01:56:15 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-3407795292873764774</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-04T15:26:15.477+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to find the time difference between timestamps using gawk?

&amp;nbsp; Let us consider a file where the

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1st column is the Process name,

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2nd...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=dsT6nB6DrHM:9eaKtRpAEFk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=dsT6nB6DrHM:9eaKtRpAEFk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=dsT6nB6DrHM:9eaKtRpAEFk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=dsT6nB6DrHM:9eaKtRpAEFk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=dsT6nB6DrHM:9eaKtRpAEFk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=dsT6nB6DrHM:9eaKtRpAEFk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=dsT6nB6DrHM:9eaKtRpAEFk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=dsT6nB6DrHM:9eaKtRpAEFk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=dsT6nB6DrHM:9eaKtRpAEFk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=dsT6nB6DrHM:9eaKtRpAEFk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=dsT6nB6DrHM:9eaKtRpAEFk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/01/gawk-calculate-date-time-difference-timestamp.html</feedburner:origLink></item><item><title>gawk -  Date and time calculation functions</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/v7dKChVSAPY/gawk-date-and-time-calculation-functions.html</link><category>GNU date</category><category>awk</category><category>awk strftime</category><category>awk date functions</category><category>awk systime</category><category>awk time</category><category>awk mktime</category><author>guru@theunixschool.com</author><pubDate>Mon, 21 Jan 2013 01:56:24 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-7793589193128503600</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-21T15:26:24.335+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>gawk has 3 functions to calculate date and time:


systime
strftime
mktime

&amp;nbsp; &amp;nbsp;Let us see in this article how to use these functions:



systime:

&amp;nbsp; &amp;nbsp;This function is equivalent...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=v7dKChVSAPY:N9vB5CBirHM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=v7dKChVSAPY:N9vB5CBirHM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=v7dKChVSAPY:N9vB5CBirHM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=v7dKChVSAPY:N9vB5CBirHM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=v7dKChVSAPY:N9vB5CBirHM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=v7dKChVSAPY:N9vB5CBirHM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=v7dKChVSAPY:N9vB5CBirHM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=v7dKChVSAPY:N9vB5CBirHM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=v7dKChVSAPY:N9vB5CBirHM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=v7dKChVSAPY:N9vB5CBirHM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=v7dKChVSAPY:N9vB5CBirHM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/01/gawk-date-and-time-calculation-functions.html</feedburner:origLink></item><item><title>What is UNIX time?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/5HSqfSSWpXY/what-is-unix-time.html</link><category>GNU date</category><category>year 2038</category><category>epoch time</category><category>timestamps</category><author>guru@theunixschool.com</author><pubDate>Thu, 17 Jan 2013 01:18:45 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-28048047560407979</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-17T14:48:45.658+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>1. What is Unix Time?

&amp;nbsp; Unix time is total number of seconds measured since &amp;nbsp;01-Jan-1970 00:00:00. &amp;nbsp;This time format is used in all the Unix flavors for time computing activities such...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=5HSqfSSWpXY:z5L-SU9g5UU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=5HSqfSSWpXY:z5L-SU9g5UU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=5HSqfSSWpXY:z5L-SU9g5UU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=5HSqfSSWpXY:z5L-SU9g5UU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=5HSqfSSWpXY:z5L-SU9g5UU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=5HSqfSSWpXY:z5L-SU9g5UU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=5HSqfSSWpXY:z5L-SU9g5UU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=5HSqfSSWpXY:z5L-SU9g5UU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=5HSqfSSWpXY:z5L-SU9g5UU:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=5HSqfSSWpXY:z5L-SU9g5UU:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=5HSqfSSWpXY:z5L-SU9g5UU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/01/what-is-unix-time.html</feedburner:origLink></item><item><title>Perl - Split a string into individual character array</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/3h5S-JWcSk0/perl-split-string-into-array.html</link><category>perl arrays</category><category>Perl</category><category>perl split string</category><author>guru@theunixschool.com</author><pubDate>Tue, 15 Jan 2013 06:41:00 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-561562249454944448</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-15T20:11:00.190+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to split a string into individual characters and store in an array in Perl? Let us see in this article how to split a string 'welcome' into separate characters.



1. Using the split...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=3h5S-JWcSk0:9PDJT6ajaWM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=3h5S-JWcSk0:9PDJT6ajaWM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=3h5S-JWcSk0:9PDJT6ajaWM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=3h5S-JWcSk0:9PDJT6ajaWM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=3h5S-JWcSk0:9PDJT6ajaWM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=3h5S-JWcSk0:9PDJT6ajaWM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=3h5S-JWcSk0:9PDJT6ajaWM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=3h5S-JWcSk0:9PDJT6ajaWM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=3h5S-JWcSk0:9PDJT6ajaWM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=3h5S-JWcSk0:9PDJT6ajaWM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=3h5S-JWcSk0:9PDJT6ajaWM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/01/perl-split-string-into-array.html</feedburner:origLink></item><item><title>Perl - How to print a hash?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/VoKqKeLQl4w/perl-how-to-print-hash.html</link><category>foreach</category><category>Perl</category><category>perl dumper</category><category>print hash</category><category>perl foreach</category><category>perl hash</category><category>perl each</category><author>guru@theunixschool.com</author><pubDate>Wed, 02 Jan 2013 01:33:39 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-6352535912348802862</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-02T15:03:39.210+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to print the contents of a hash? Let us see in this article the different options to print a hash.



1. Using foreach and keys:

#!/usr/bin/perl

use warnings;
use strict;

$\="\n";

my %h1=(Jan...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=VoKqKeLQl4w:mQn-2oEjn50:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=VoKqKeLQl4w:mQn-2oEjn50:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=VoKqKeLQl4w:mQn-2oEjn50:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=VoKqKeLQl4w:mQn-2oEjn50:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=VoKqKeLQl4w:mQn-2oEjn50:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=VoKqKeLQl4w:mQn-2oEjn50:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=VoKqKeLQl4w:mQn-2oEjn50:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=VoKqKeLQl4w:mQn-2oEjn50:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=VoKqKeLQl4w:mQn-2oEjn50:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=VoKqKeLQl4w:mQn-2oEjn50:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=VoKqKeLQl4w:mQn-2oEjn50:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2013/01/perl-how-to-print-hash.html</feedburner:origLink></item><item><title>Perl - Return a value from function depending on the context</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/lnjpxYgOw-0/perl-return-value-function-depending-context.html</link><category>perl builtin function</category><category>Perl</category><category>CPAN module</category><category>wantarray example</category><author>guru@theunixschool.com</author><pubDate>Wed, 19 Dec 2012 00:31:30 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-255083900619859940</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-19T14:01:30.436+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>&amp;nbsp;How to return a value from a function depending on the context? For example, if the return value is collected into an array, the function should return an array, if collected in a scalar, then...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=lnjpxYgOw-0:ulRzvIYjkJc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=lnjpxYgOw-0:ulRzvIYjkJc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=lnjpxYgOw-0:ulRzvIYjkJc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=lnjpxYgOw-0:ulRzvIYjkJc:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=lnjpxYgOw-0:ulRzvIYjkJc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=lnjpxYgOw-0:ulRzvIYjkJc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=lnjpxYgOw-0:ulRzvIYjkJc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=lnjpxYgOw-0:ulRzvIYjkJc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=lnjpxYgOw-0:ulRzvIYjkJc:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=lnjpxYgOw-0:ulRzvIYjkJc:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=lnjpxYgOw-0:ulRzvIYjkJc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/12/perl-return-value-function-depending-context.html</feedburner:origLink></item><item><title>Shell Script - How to dump a Oracle table into a CSV file?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/LcEtAvlpD1o/shell-script-how-to-dump-oracle-table-into-csv-file.html</link><category>Oracle table csv</category><category>table to csv</category><category>shell script</category><author>guru@theunixschool.com</author><pubDate>Mon, 17 Dec 2012 02:32:41 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-7053414661956939999</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-17T16:02:41.865+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to dump /export the contents of an Oracle table into a CSV file? Let us write a shell script to dump the content of EMP table into a CSV file.



Shell...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=LcEtAvlpD1o:Qqw68jrwQho:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=LcEtAvlpD1o:Qqw68jrwQho:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=LcEtAvlpD1o:Qqw68jrwQho:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=LcEtAvlpD1o:Qqw68jrwQho:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=LcEtAvlpD1o:Qqw68jrwQho:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=LcEtAvlpD1o:Qqw68jrwQho:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=LcEtAvlpD1o:Qqw68jrwQho:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=LcEtAvlpD1o:Qqw68jrwQho:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=LcEtAvlpD1o:Qqw68jrwQho:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=LcEtAvlpD1o:Qqw68jrwQho:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=LcEtAvlpD1o:Qqw68jrwQho:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/12/shell-script-how-to-dump-oracle-table-into-csv-file.html</feedburner:origLink></item><item><title>How to print every nth line in a file in Linux?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/SHJNj0Rdw0Y/how-to-print-every-nth-line-in-file-in.html</link><category>Different ways of</category><category>print nth line</category><category>perl one liners</category><category>shell script</category><category>awk one liners</category><category>sed one liners</category><author>guru@theunixschool.com</author><pubDate>Wed, 12 Dec 2012 02:09:47 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-8245325870819168725</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-12T15:39:47.168+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to print every nth line of a file? &amp;nbsp;The requirement is to print every 3rd line of the file.

&amp;nbsp; Let us consider a file with the following content.

$ cat...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=SHJNj0Rdw0Y:gsQ6rb8cmgk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=SHJNj0Rdw0Y:gsQ6rb8cmgk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=SHJNj0Rdw0Y:gsQ6rb8cmgk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=SHJNj0Rdw0Y:gsQ6rb8cmgk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=SHJNj0Rdw0Y:gsQ6rb8cmgk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=SHJNj0Rdw0Y:gsQ6rb8cmgk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=SHJNj0Rdw0Y:gsQ6rb8cmgk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=SHJNj0Rdw0Y:gsQ6rb8cmgk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=SHJNj0Rdw0Y:gsQ6rb8cmgk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=SHJNj0Rdw0Y:gsQ6rb8cmgk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=SHJNj0Rdw0Y:gsQ6rb8cmgk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/12/how-to-print-every-nth-line-in-file-in.html</feedburner:origLink></item><item><title>sed - 10 examples to  print lines from a file</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/ryJkIGS4m1o/sed-10-examples-to-print-lines-from-file.html</link><category>sed tutorial</category><category>sed print line</category><category>sed</category><author>guru@theunixschool.com</author><pubDate>Tue, 11 Dec 2012 06:44:11 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-8579015762304838582</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-11T20:14:11.403+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>&amp;nbsp;In this article of sed series, we will see how to print a particular line using the print(p) command of sed.

&amp;nbsp; Let us consider a file with the following contents:

$ cat...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=ryJkIGS4m1o:edqY-UnIoDQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=ryJkIGS4m1o:edqY-UnIoDQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=ryJkIGS4m1o:edqY-UnIoDQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=ryJkIGS4m1o:edqY-UnIoDQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=ryJkIGS4m1o:edqY-UnIoDQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=ryJkIGS4m1o:edqY-UnIoDQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=ryJkIGS4m1o:edqY-UnIoDQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=ryJkIGS4m1o:edqY-UnIoDQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=ryJkIGS4m1o:edqY-UnIoDQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=ryJkIGS4m1o:edqY-UnIoDQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=ryJkIGS4m1o:edqY-UnIoDQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/12/sed-10-examples-to-print-lines-from-file.html</feedburner:origLink></item><item><title>10 examples of initializing a Hash variable in Perl</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/HA4Fv9tY4Xw/10-examples-initializing-hash-perl.html</link><category>map</category><category>perl arrays</category><category>Perl</category><category>perl hash examples</category><category>perl hash</category><author>guru@theunixschool.com</author><pubDate>Wed, 05 Dec 2012 08:08:42 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-2760653205878624775</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-05T21:38:42.496+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>&amp;nbsp;Hash'es&amp;nbsp;&amp;nbsp;is one of the most important concepts in Perl. Hashes are associative arrays where the data is stored in the form of key-value pairs. The big advantage of a hash is faster...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=HA4Fv9tY4Xw:t1e0bBDzGgg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=HA4Fv9tY4Xw:t1e0bBDzGgg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=HA4Fv9tY4Xw:t1e0bBDzGgg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=HA4Fv9tY4Xw:t1e0bBDzGgg:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=HA4Fv9tY4Xw:t1e0bBDzGgg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=HA4Fv9tY4Xw:t1e0bBDzGgg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=HA4Fv9tY4Xw:t1e0bBDzGgg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=HA4Fv9tY4Xw:t1e0bBDzGgg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=HA4Fv9tY4Xw:t1e0bBDzGgg:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=HA4Fv9tY4Xw:t1e0bBDzGgg:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=HA4Fv9tY4Xw:t1e0bBDzGgg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/12/10-examples-initializing-hash-perl.html</feedburner:origLink></item><item><title>How to remove the leading and trailing spaces in a file?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/bitTxHLFeEA/howto-remove-leading-trailing-spaces.html</link><category>bash</category><category>perl one liners</category><category>shell script</category><category>awk one liners</category><category>sed one liners</category><author>guru@theunixschool.com</author><pubDate>Mon, 03 Dec 2012 02:04:13 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-2356716916387492460</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-03T15:34:13.277+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to remove / delete the leading and trailing spaces in a file? How to replace a group of spaces with a single space?

&amp;nbsp; &amp;nbsp; Let us consider a file with the below content:

$ cat file
...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=bitTxHLFeEA:kejl9M3aM6E:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=bitTxHLFeEA:kejl9M3aM6E:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=bitTxHLFeEA:kejl9M3aM6E:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=bitTxHLFeEA:kejl9M3aM6E:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=bitTxHLFeEA:kejl9M3aM6E:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=bitTxHLFeEA:kejl9M3aM6E:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=bitTxHLFeEA:kejl9M3aM6E:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=bitTxHLFeEA:kejl9M3aM6E:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=bitTxHLFeEA:kejl9M3aM6E:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=bitTxHLFeEA:kejl9M3aM6E:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=bitTxHLFeEA:kejl9M3aM6E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/12/howto-remove-leading-trailing-spaces.html</feedburner:origLink></item><item><title>25 examples of vi / vim substitution commands</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/eYAqPi22jFE/examples-vi-vim-substitution-commands.html</link><category>vim</category><category>VI editor</category><category>substitution</category><author>guru@theunixschool.com</author><pubDate>Tue, 27 Nov 2012 22:20:21 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-8201683130506429025</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-28T11:50:21.345+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>&amp;nbsp;In this article, we will see the commonly used vi substitution commands. All the below commands are to be given in escape mode:



Common tricks:

1. To replace the 1st occurrence of 'a' with...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eYAqPi22jFE:QXjhIl3kyqk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eYAqPi22jFE:QXjhIl3kyqk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=eYAqPi22jFE:QXjhIl3kyqk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eYAqPi22jFE:QXjhIl3kyqk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eYAqPi22jFE:QXjhIl3kyqk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=eYAqPi22jFE:QXjhIl3kyqk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eYAqPi22jFE:QXjhIl3kyqk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=eYAqPi22jFE:QXjhIl3kyqk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eYAqPi22jFE:QXjhIl3kyqk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=eYAqPi22jFE:QXjhIl3kyqk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eYAqPi22jFE:QXjhIl3kyqk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/11/examples-vi-vim-substitution-commands.html</feedburner:origLink></item><item><title>awk - 10 examples to insert / remove / update fields of a CSV file</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/s75iZLiU340/awk-examples-insert-remove-update-fields.html</link><category>awk insert column</category><category>awk</category><category>delete</category><category>linux</category><category>awk parse CSV</category><category>update</category><category>unix</category><category>join</category><category>awk one liners</category><author>guru@theunixschool.com</author><pubDate>Sun, 25 Nov 2012 23:22:03 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-3305459963482280955</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-26T12:52:03.332+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><description>How to manipulate a text / CSV file using awk/gawk? How to insert/add a column between columns, remove columns, or to update a particular column? Let us discuss in this article.




Consider a CSV...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s75iZLiU340:wXVMquz43Nk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s75iZLiU340:wXVMquz43Nk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=s75iZLiU340:wXVMquz43Nk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s75iZLiU340:wXVMquz43Nk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s75iZLiU340:wXVMquz43Nk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=s75iZLiU340:wXVMquz43Nk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s75iZLiU340:wXVMquz43Nk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=s75iZLiU340:wXVMquz43Nk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s75iZLiU340:wXVMquz43Nk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=s75iZLiU340:wXVMquz43Nk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=s75iZLiU340:wXVMquz43Nk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/11/awk-examples-insert-remove-update-fields.html</feedburner:origLink></item><item><title>7 examples of find command with xargs in Linux</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/eIfpNAEzQwI/examples-find-command-xargs-linux.html</link><category>xargs</category><category>find xargs</category><category>find</category><category>commands</category><author>guru@theunixschool.com</author><pubDate>Thu, 22 Nov 2012 01:15:15 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-6110164956564441499</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-22T14:45:15.047+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>&amp;nbsp;find command becomes very powerful when used with xargs. xargs is a beautiful command which actually builds a command and executes it. Though xargs command can be used standalone to work on...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eIfpNAEzQwI:OuvRoT6G-gU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eIfpNAEzQwI:OuvRoT6G-gU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=eIfpNAEzQwI:OuvRoT6G-gU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eIfpNAEzQwI:OuvRoT6G-gU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eIfpNAEzQwI:OuvRoT6G-gU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=eIfpNAEzQwI:OuvRoT6G-gU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eIfpNAEzQwI:OuvRoT6G-gU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=eIfpNAEzQwI:OuvRoT6G-gU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eIfpNAEzQwI:OuvRoT6G-gU:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=eIfpNAEzQwI:OuvRoT6G-gU:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=eIfpNAEzQwI:OuvRoT6G-gU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/11/examples-find-command-xargs-linux.html</feedburner:origLink></item><item><title>How to swap 2 columns in a file in  Linux?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/p0i6b16FP40/how-to-swap-2-columns-in-file-in-linux.html</link><category>swap columns</category><category>Shell Scripting</category><category>different methods</category><category>bash</category><category>perl one liners</category><category>join</category><category>how to</category><category>awk one liners</category><author>guru@theunixschool.com</author><pubDate>Mon, 19 Nov 2012 02:01:24 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-3302251653858254937</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-19T15:31:24.386+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to swap 2 columns or fields in a text or a CSV file?




Let us consider a file with the following contents. The requirement is to swap the first 2 fields:

$ cat...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=p0i6b16FP40:TiV5SZMvGTU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=p0i6b16FP40:TiV5SZMvGTU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=p0i6b16FP40:TiV5SZMvGTU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=p0i6b16FP40:TiV5SZMvGTU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=p0i6b16FP40:TiV5SZMvGTU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=p0i6b16FP40:TiV5SZMvGTU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=p0i6b16FP40:TiV5SZMvGTU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=p0i6b16FP40:TiV5SZMvGTU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=p0i6b16FP40:TiV5SZMvGTU:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=p0i6b16FP40:TiV5SZMvGTU:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=p0i6b16FP40:TiV5SZMvGTU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/11/how-to-swap-2-columns-in-file-in-linux.html</feedburner:origLink></item><item><title>How to retrieve or extract the tag value from XML in Linux?</title><link>http://feedproxy.google.com/~r/http/unix-schoolblogspotcom/~3/n66pbRWCiFM/howto-retrieve-extract-tag-value-xml-linux.html</link><category>tags</category><category>perl one liners</category><category>XML</category><category>how to</category><category>values</category><category>awk one liners</category><category>grep command</category><category>sed one liners</category><author>guru@theunixschool.com</author><pubDate>Wed, 07 Nov 2012 01:38:21 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1255024703457423340.post-3395114414286666084</guid><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-07T15:08:21.053+05:30</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><description>How to fetch the tag value for a given tag from a simple XML file?

&amp;nbsp; Let us consider a simple XML file, cust.xml, with &amp;nbsp;customer details as below:

&amp;lt;?xml version="1.0"...&lt;br/&gt;
&lt;br/&gt;
{To read the article from the blog, click the title above.}&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=n66pbRWCiFM:8DDCekac7FI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=n66pbRWCiFM:8DDCekac7FI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=n66pbRWCiFM:8DDCekac7FI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=n66pbRWCiFM:8DDCekac7FI:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=n66pbRWCiFM:8DDCekac7FI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=n66pbRWCiFM:8DDCekac7FI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=n66pbRWCiFM:8DDCekac7FI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=n66pbRWCiFM:8DDCekac7FI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=n66pbRWCiFM:8DDCekac7FI:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?i=n66pbRWCiFM:8DDCekac7FI:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?a=n66pbRWCiFM:8DDCekac7FI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/http/unix-schoolblogspotcom?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://www.theunixschool.com/2012/11/howto-retrieve-extract-tag-value-xml-linux.html</feedburner:origLink></item><media:rating>nonadult</media:rating></channel></rss>
