<?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>The Boschmans Account &#187; csv</title>
	<atom:link href="http://www.boschmans.net/tag/csv/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.boschmans.net</link>
	<description>A collection of interests and happenings...</description>
	<lastBuildDate>Mon, 19 Jul 2010 19:36:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WeightManDesktop, an AIR application for Weightman (iTunes)</title>
		<link>http://www.boschmans.net/2009/09/24/weightmandesktop-an-air-application-for-weightman-itunes/</link>
		<comments>http://www.boschmans.net/2009/09/24/weightmandesktop-an-air-application-for-weightman-itunes/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 22:14:08 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[flex3]]></category>

		<guid isPermaLink="false">http://www.boschmans.net/?p=764</guid>
		<description><![CDATA[Here&#8217;s a small application called WeightManDesktop that I wrote as a proof of concept to see how difficult it was to import a csv file and process it in actionscript. I blogged about it earlier here. It uses the csv file that is generated by WeightMan (iTunes link), a free iPhone program that allows you to [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-827" href="http://www.boschmans.net/2009/11/08/weightmandesktop-v-0-2-air/wdm-r2/"><img class="alignnone size-medium wp-image-827" title="WDM-r2" src="http://www.boschmans.net/wp-content/uploads/2009/11/WDM-r2-300x204.png" alt="WDM-r2" width="300" height="204" /></a></p>
<p>Here&#8217;s a small application called <a href="http://www.boschmans.net/wp-content/uploads/2009/09/WeightManDesktop.air">WeightManDesktop</a> that I wrote as a proof of concept to see how difficult it was to import a csv file and process it in actionscript. I blogged about it earlier <a href="http://www.boschmans.net/2009/09/12/reading-and-displaying-a-csv-file-using-flex-air-and-actionscript/" target="_blank">here</a>.</p>
<p>It uses the csv file that is generated by <a title="Weightman" href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291576335&amp;mt=8" target="_blank">WeightMan</a> (iTunes link), a free iPhone program that allows you to note your weight over time intervals. Weightman allows you to export your entries in csv and sent them by mail to your desktop. I wanted a desktop application that could display all the entries in one go.</p>
<p>The iPhone app is made by <a title="Katachi studios" href="http://www.katachistudio.co.jp/index_en.html" target="_blank">Katachi studios</a>. I did try to contact them to let them know I was posting this, but as their site is partly in japanese and there is only a small english page, I couldn&#8217;t find the contact email&#8230; [update: I managed to contact them, and they seem happy with it <img src='http://www.boschmans.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ]</p>
<p>To use the program, use the install badge below - it&#8217;s an<a title="wiki Adobe AIR page" href="http://en.wikipedia.org/wiki/Adobe_Integrated_Runtime" target="_blank"> AIR</a> application, so you need to first install the <a title="Adobe AIR" href="http://get.adobe.com/air/" target="_blank">run-time air player</a> as well if you haven&#8217;t done so before. I&#8217;ll make a proper install badge for it sometime in the future if or when I revise the program.</p>
<p>Use the source button on the bottom of the screen to locate the csv file and import it. Two graphs will then be shown, one showing your weight and one showing your body mass index level, as calculated by Weightman.  There&#8217;s a toggle button to show only the last 30 entries as well.</p>
<p>It&#8217;s a very basic first release, but I may add additional functionality it in the future. If you would like an improvement or see something to fix, please leave a comment.</p>
<p>[Update: link changed to point to version 0.2 - changes are described <a title="WeightManDesktop v.0.2" href="http://www.boschmans.net/2009/11/08/weightmandesktop-v-0-2-air/" target="_self">here</a>]</p>
<p><div id="flashcontent3905" style="width:215px; height:180px;"><strong>Please upgrade your Flash Player</strong> This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.</div><script type="text/javascript">
<!-- // <![CDATA[
var so = new SWFObject("http://www.boschmans.net/wp-content/plugins/air-badge/AIRInstallBadge.swf", "Badge", "215", "180", "9.0.115", "#FFFFFF");
so.useExpressInstall("http://www.boschmans.net/wp-content/plugins/air-badge/expressinstall.swf");
so.addVariable("airversion", "1.0");
so.addVariable("appname", "WeightManDesktop");
so.addVariable("appurl", "http://www.boschmans.net/wp-content/uploads/2009/11/WeightManDesktop.air");
so.addVariable("appid", "WeightManDesktop");
so.addVariable("pubid", "");
so.addVariable("appversion", "0.2");
so.addVariable("imageurl", "http://www.boschmans.net/wp-content/uploads/2009/11/WDM-r2.png");
so.addVariable("appinstallarg", "installed from web");
so.addVariable("applauncharg", "launched from web");
so.addVariable("helpurl", "help.html");
so.addVariable("hidehelp", "true");
so.addVariable("skiptransition", "false");
so.addVariable("titlecolor", "#00AAFF");
so.addVariable("buttonlabelcolor", "#00AAFF");
so.addVariable("appnamecolor", "#00AAFF");
so.addVariable("str_err_airswf", "<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this is run from the local file system.");
so.write("flashcontent3905");
// ]]&gt; -->
</script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.boschmans.net/2009/09/24/weightmandesktop-an-air-application-for-weightman-itunes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reading and Displaying a csv file using Flex (AIR) and Actionscript</title>
		<link>http://www.boschmans.net/2009/09/12/reading-and-displaying-a-csv-file-using-flex-air-and-actionscript/</link>
		<comments>http://www.boschmans.net/2009/09/12/reading-and-displaying-a-csv-file-using-flex-air-and-actionscript/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 11:25:22 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[flex3]]></category>

		<guid isPermaLink="false">http://www.boschmans.net/?p=738</guid>
		<description><![CDATA[I&#8217;ve already written a python script that can convert a .csv file to a .xml file, which quite a few people seem to like. This is a good solution when you have a large file to convert. But really, reading a small and simple csv file directly into Flex/Flash to use it in charts or [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve already written a python script that can <a href="http://www.boschmans.net/2009/01/21/converting-xls-to-xml-via-csv-using-python/">convert</a> a .csv file to a .xml file, which quite a few people seem to like. This is a good solution when you have a large file to convert.</p>
<p>But really, reading a small and simple csv file directly into Flex/Flash to use it in charts or display the contents in a DataGrid would be a &#8220;Nice To Have&#8221; solution. Plus, I&#8217;ve noticed that over the years I reuse my code and each time I add new functionality to it; now is the time to start with it !</p>
<p>So I made an AIR application ( for the simple reason that I load a local csv file) that does exactly that. The AIR app is called <a title="WeightManDesktop" href="http://www.boschmans.net/2009/09/24/weightmandesktop-an-air-application-for-weightman-itunes/" target="_self">WeightManDesktop</a>.</p>
<p>Since I know it&#8217;s a small file that I&#8217;m loading, it doesn&#8217;t matter that I load it completely into memory. For a larger file, in Python I would typically open the file for reading and read it line by line, processing each line as I go.</p>
<p>Using the <a title="File.browseForOpen" href="http://livedocs.adobe.com/flex/3/langref/flash/filesystem/File.html#browseForOpen()" target="_blank">File.browseForOpen</a> AIR functionality, I read in the file selected by the user into a string and then process the content in a seperate function:</p>
<p>// Read in the selected file when the file is selected<br />
private function openfileSRCHandler(event:Event):void{<br />
fileStream.open(file, FileMode.READ);<br />
content = String(fileStream.readUTFBytes(fileStream.bytesAvailable));<br />
fileStream.close();<br />
trace(&#8220;*** File loaded.&#8221;);<br />
processContent();<br />
}</p>
<p>Using the strings <a title="Adobe String Split function" href="http://livedocs.adobe.com/flex/3/langref/String.html#split()" target="_blank">split</a> function, I first split the string into seperate lines using the line seperator to split them. Each line thus becomes an Array. I then split each line into seperate content, again using the split function using commas to seperate them into the seperate items. These items are then added to an ArrayCollection that I&#8217;ve previously defined.</p>
<p>private function processContent():void {<br />
//var ending:String = new String(&#8220;\n\g&#8221;);<br />
// Split the whole file into lines<br />
var values:Array;<br />
var lines:Array = content.split(&#8220;\n&#8221;);<br />
trace (&#8220;File split into &#8221; + lines.length + &#8221; lines&#8221;);<br />
// Split each line into data content &#8211; start from 1 instead of 0 as this is a header line.<br />
for ( var i: Number=1; i &lt; lines.length; i++ ) {<br />
var line: String = lines[i];<br />
values = line.split(&#8220;,&#8221;);<br />
trace (&#8220;line split in &#8221; + values);</p>
<p>// Add values to arraycollection<br />
linedata.addItem({date:values[0], weight:values[1], bmi:values[2], workout:values[3]});</p>
<p>And that&#8217;s it. Use the ArrayCollection as a dataprovider for your datagrid and Bob&#8217;s your Uncle !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.boschmans.net/2009/09/12/reading-and-displaying-a-csv-file-using-flex-air-and-actionscript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Version 1.8 of CSV2XML is out</title>
		<link>http://www.boschmans.net/2009/04/19/version-18-of-csv2xml-is-out/</link>
		<comments>http://www.boschmans.net/2009/04/19/version-18-of-csv2xml-is-out/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:48:52 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.boschmans.net/?p=603</guid>
		<description><![CDATA[Thanks to a comment from a user of the program who had problems getting the script to process csv files on the mac, I&#8217;ve updated the script to version 1.8 so it will now open them without first needing to save the file in unix format when exporting to csv from Office for Mac. For [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to a comment from a <a title="ETP" href="http://www.emergingtechnologypartners.com" target="_blank">user</a> of the program who had problems getting the script to process csv files on the mac, I&#8217;ve updated the script to version 1.8 so it will now open them without first needing to save the file in unix format when exporting to csv from Office for Mac.</p>
<p>For those of you who noted the version skip, version 1.7 has not been released, but just includes a simple test to see if the first field is empty or not. If empty the line is dropped. It&#8217;s been commented out in the latest version. Since my hosting provider also does python, I have renamed the file to .txt. Simply rename it to .py to have it working.</p>
<p><a href="http://www.boschmans.net/wp-content/uploads/2009/04/csv2xml_v18.txt">csv2xml_v18</a></p>
<p>[For the Pythonistas : I've set the csv module to now open the files in read 'universal' mode]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.boschmans.net/2009/04/19/version-18-of-csv2xml-is-out/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
