<?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>My Daily Computer Solutions &#187; output</title>
	<atom:link href="http://www.dailycomputersolutions.com/blog/index.php/iphone,problems,jobvermeulen,blog,daily,solutions/output/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailycomputersolutions.com/blog</link>
	<description>All day computer problems with solutions and advice.</description>
	<lastBuildDate>Tue, 20 Dec 2011 13:41:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PERL input and output files</title>
		<link>http://www.dailycomputersolutions.com/blog/index.php/2008/11/17/perl-input-and-output-files/</link>
		<comments>http://www.dailycomputersolutions.com/blog/index.php/2008/11/17/perl-input-and-output-files/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 19:25:25 +0000</pubDate>
		<dc:creator>Job Vermeulen (admin)</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[output]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.dailycomputersolutions.com/blog/?p=140</guid>
		<description><![CDATA[To read an input file, edit your data and put it to an output file try this: #! /usr/bin/perl -w use strict; my $file = &#8220;in.csv&#8221;; my $outfile = &#8220;out.csv&#8221;; open(IN, &#8220;&#60;$file&#8221;) or die &#8220;Could not open $file\n&#8221;; open(OUT, &#8220;&#62;$outfile&#8221;) &#8230; <a href="http://www.dailycomputersolutions.com/blog/index.php/2008/11/17/perl-input-and-output-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To read an input file, edit your data and put it to an output file try this:</p>
<p>#! /usr/bin/perl -w</p>
<p>use strict;</p>
<p>my $file = &#8220;in.csv&#8221;;<br />
my $outfile = &#8220;out.csv&#8221;;</p>
<p>open(IN, &#8220;<strong>&lt;</strong>$file&#8221;) or die &#8220;Could not open $file\n&#8221;;<br />
open(OUT, &#8220;<strong>&gt;</strong>$outfile&#8221;) or die &#8220;Could not open $outfile\n&#8221;;</p>
<p>while (&lt;IN&gt;)<br />
{<br />
chomp;<br />
my @line = <strong>split(&#8220;,&#8221;);</strong> # this char is the separation sign.</p>
<p># Your data will now be in a array called line[ ].</p>
<p># Do whatever you want, access the data with the varable $line[FIELDNUMBER]<br />
# Example: $line[3] = &#8216;blablbla&#8217; #edit the 4th value from the input file.</p>
<p>print OUT &#8220;$line[0],$line[3],$line[2]&#8220;\n&#8221;; # write back to output file<br />
}<br />
# close the both files (importend! else the writing will not take place due caching!)<br />
close(IN);<br />
close(OUT);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailycomputersolutions.com/blog/index.php/2008/11/17/perl-input-and-output-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

