<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codec &#187; string</title>
	<atom:link href="http://www.trembl.org/codec/tag/string/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trembl.org/codec</link>
	<description>A Personal Polylogic Code/Decode &#039;Zettelkasten&#039;</description>
	<lastBuildDate>Thu, 02 Feb 2012 03:38:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The 11G Text-Edit Challenge</title>
		<link>http://www.trembl.org/codec/647/</link>
		<comments>http://www.trembl.org/codec/647/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 02:47:34 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[large]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[tab]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=647</guid>
		<description><![CDATA[Ok, here&#8217;s a challenge. Say, you have a massive, 11 Gigabyte text file. The first two lines are the header files, unfortunately the header on line 2 is slightly wrong: Instead of &#8216;Done&#8217; it should say &#8216;Status:Done&#8217;. (Hit: &#8216;Done&#8217; is the first occurrence of that string in that line) Any Ideas? - split and the [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, here&#8217;s a challenge. Say, you have a massive, 11 Gigabyte text file. The first two lines are the header files, unfortunately the header on line 2 is slightly wrong: Instead of &#8216;Done&#8217; it should say &#8216;Status:Done&#8217;. (Hit: &#8216;Done&#8217; is the first occurrence of that string in that line) </p>
<p>Any Ideas?</p>
<p>- split and the cat? Could not figure out to split it in uneven files, i.e. the first 2 lines and the rest&#8230;<br />
- vi? Seems to open, but bulks when saving it.</p>
<p><strong>[Update]</strong></p>
<p><strong>sed</strong> seems to be the tool for this job.<br />
<code>sed '2 s/Done/Status:Done/' input.txt > output.txt</code></p>
<p>Took about 7 minutes on my machine&#8230; Any better ideas still very much appreciated.</p>
<p><strong>[Update 2: How to insert a tab with sed</strong>]</p>
<p>Inserting a tab with sed turned out to be more resilient than expected. Neither an escaped tab (\t) not a double-escaped tab (\\t) seemed to do the trick. On bash it is necessary to drop out of sed and print the tab (\011) directly. 27 in the following statement means of course line 27.</p>
<p><code>sed '27 s/Done/Status:Done'"$(printf '\011')"'After Tab/' in.txt > out.txt</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/647/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting float to string %4.2f</title>
		<link>http://www.trembl.org/codec/305/</link>
		<comments>http://www.trembl.org/codec/305/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 10:26:34 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[char]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[precision]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[printf]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=305</guid>
		<description><![CDATA[printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416); floats: 3.14 +3e+000 3.141600E+000]]></description>
			<content:encoded><![CDATA[<p><code>printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);<br />
</code><br />
floats: 3.14 +3e+000 3.141600E+000</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/305/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concatenating Strings @&#8221;string1&#8243; @&#8221;string2&#8243; @&#8221;stringN&#8221;</title>
		<link>http://www.trembl.org/codec/73/</link>
		<comments>http://www.trembl.org/codec/73/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 06:44:27 +0000</pubDate>
		<dc:creator>Georg Tremmel</dc:creator>
				<category><![CDATA[Raw]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[combine]]></category>
		<category><![CDATA[concatenate]]></category>
		<category><![CDATA[directive]]></category>
		<category><![CDATA[NSString]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://www.trembl.org/codec/?p=73</guid>
		<description><![CDATA[That&#8217;s basically it. No more [@"string1" stringByAppendingString:@"string2"]; or [NSString stringWithFormat:@"string1%@", @"string1"]; just @"string1" @"string2" @"stringN" -> @"string1string2stringN" The Objective-C 2.0 Programming Language.pdf, p131]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s basically it.</p>
<p>No more<br />
<code>[@"string1" stringByAppendingString:@"string2"];</code></p>
<p>or<br />
<code>[NSString stringWithFormat:@"string1%@", @"string1"];</code></p>
<p>just<br />
<code>@"string1" @"string2" @"stringN"</code> -> <code>@"string1string2stringN"</code></p>
<p><em><a href="http://developer.apple.com/documentation/cocoa/conceptual/objectiveC/objc.pdf">The Objective-C 2.0 Programming Language.pdf</a>, p131</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.trembl.org/codec/73/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

