<?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>Coreutils on Raveen Kumar</title>
    <link>https://raveenkumar.com/tags/coreutils/</link>
    <description>Recent content in Coreutils on Raveen Kumar</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>Raveen Kumar</copyright>
    <lastBuildDate>Wed, 03 May 2023 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://raveenkumar.com/tags/coreutils/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Horizontally print file contents</title>
      <link>https://raveenkumar.com/posts/2023-05-03-horizontally-print-file-contents/</link>
      <pubDate>Wed, 03 May 2023 00:00:00 +0000</pubDate>
      <guid>https://raveenkumar.com/posts/2023-05-03-horizontally-print-file-contents/</guid>
      <description>&lt;p&gt;To concatenate the contents of a vertical file horizontally in Unix, you can use the &lt;code&gt;paste&lt;/code&gt; command with the &lt;code&gt;-s&lt;/code&gt; option.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s an example:&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say you have a file &lt;code&gt;file.txt&lt;/code&gt; with the following vertical content:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;apple&#xA;banana&#xA;orange&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can concatenate the contents horizontally using the following command:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;paste -s file.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will produce the output:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;apple   banana  orange&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;-s&lt;/code&gt; option tells &lt;code&gt;paste&lt;/code&gt; to concatenate the lines horizontally instead of vertically. By default, &lt;code&gt;paste&lt;/code&gt; separates the columns with a tab character. If you want to use a different separator, you can specify it with the &lt;code&gt;-d&lt;/code&gt; option followed by the separator character. For example:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
