<?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: Split a text file in half (or any percentage) on Ubuntu Linux</title>
	<atom:link href="http://www.howtogeek.com/howto/ubuntu/split-a-text-file-in-half-or-any-percentage-on-ubuntu-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.howtogeek.com/howto/ubuntu/split-a-text-file-in-half-or-any-percentage-on-ubuntu-linux/</link>
	<description>Computer Help from your Friendly How-To Geek</description>
	<lastBuildDate>Sun, 08 Nov 2009 07:56:33 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Simon C. Ion</title>
		<link>http://www.howtogeek.com/howto/ubuntu/split-a-text-file-in-half-or-any-percentage-on-ubuntu-linux/comment-page-1/#comment-69442</link>
		<dc:creator>Simon C. Ion</dc:creator>
		<pubDate>Sun, 29 Mar 2009 12:06:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.howtogeek.com/howto/ubuntu/split-a-text-file-in-half-or-any-percentage-on-ubuntu-linux/#comment-69442</guid>
		<description>If you have bc and sed installed, why not do this to calculate the halfway point of the file and perform the split?

split -l $(echo $(cat tmp.txt &#124; wc -l)/2 &#124; bc -l &#124; sed -e &#039;s/\..*//&#039;) access.log


NB: bc seems to default to a floating-point output. The sed invocation effectively act as a call to floor(3), stripping away the numbers after the decimal, and making my version of split happy. I guess that the sed expression would need to be changed to &#039;s/,.*//&#039; for locales that use &#039;,&#039; as their &quot;numbers after the decimal&quot; indicator.</description>
		<content:encoded><![CDATA[<p>If you have bc and sed installed, why not do this to calculate the halfway point of the file and perform the split?</p>
<p>split -l $(echo $(cat tmp.txt | wc -l)/2 | bc -l | sed -e &#8217;s/\..*//&#8217;) access.log</p>
<p>NB: bc seems to default to a floating-point output. The sed invocation effectively act as a call to floor(3), stripping away the numbers after the decimal, and making my version of split happy. I guess that the sed expression would need to be changed to &#8217;s/,.*//&#8217; for locales that use &#8216;,&#8217; as their &#8220;numbers after the decimal&#8221; indicator.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
