<?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: CSV import enhancement</title>
	<atom:link href="http://kohei.us/2009/06/09/csv-import-enhancement/feed/" rel="self" type="application/rss+xml" />
	<link>http://kohei.us/2009/06/09/csv-import-enhancement/</link>
	<description>Kohei Yoshida&#039;s Webspace</description>
	<lastBuildDate>Thu, 15 Mar 2012 23:34:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kohei Yoshida</title>
		<link>http://kohei.us/2009/06/09/csv-import-enhancement/comment-page-1/#comment-9827</link>
		<dc:creator>Kohei Yoshida</dc:creator>
		<pubDate>Fri, 30 Oct 2009 04:50:13 +0000</pubDate>
		<guid isPermaLink="false">http://kohei.us/?p=486#comment-9827</guid>
		<description>Ah, yes.  I remember I modified the FilterOptions handling code.

Basically, the new FilterOptions value has two boolean values appended to the end after Cell Format Codes for the four Columns (5), and one integer value between the Character Set (3) and the Number of First Line (4).  The new integer value is the language ID, while the two boolean values are for the &quot;Quoted field as text&quot; and &quot;Detect special numbers&quot; options in this order.

The usable language ID&#039;s are listed here:
http://svn.services.openoffice.org/opengrok/xref/Current%20(trunk)/i18npool/inc/i18npool/lang.h

That wiki documentation page should probably be updated once this feature lands...</description>
		<content:encoded><![CDATA[<p>Ah, yes.  I remember I modified the FilterOptions handling code.</p>
<p>Basically, the new FilterOptions value has two boolean values appended to the end after Cell Format Codes for the four Columns (5), and one integer value between the Character Set (3) and the Number of First Line (4).  The new integer value is the language ID, while the two boolean values are for the &#8220;Quoted field as text&#8221; and &#8220;Detect special numbers&#8221; options in this order.</p>
<p>The usable language ID&#8217;s are listed here:<br />
<a href="http://svn.services.openoffice.org/opengrok/xref/Current%20(trunk)/i18npool/inc/i18npool/lang.h" rel="nofollow">http://svn.services.openoffice.org/opengrok/xref/Current%20(trunk)/i18npool/inc/i18npool/lang.h</a></p>
<p>That wiki documentation page should probably be updated once this feature lands&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gábor Németh</title>
		<link>http://kohei.us/2009/06/09/csv-import-enhancement/comment-page-1/#comment-9824</link>
		<dc:creator>Gábor Németh</dc:creator>
		<pubDate>Thu, 29 Oct 2009 12:01:57 +0000</pubDate>
		<guid isPermaLink="false">http://kohei.us/?p=486#comment-9824</guid>
		<description>OK;  here is what I wanted to use this for.  My input consist of lines like

sometextnumbernumber

where columns are separated by tabs, and cells may be padded by spaces.  In the Calc sheet I want to get rid of the spaces and have the numbers as numbers.

The macro I wanted to have is like:

sub main
dim doc2 as object
doc2 = loadClusteringCSV(&quot;file:///input.txt&quot;)
end sub

sub loadClusteringCSV(byval url as string) as object
  dim doc as object
  dim props(1) as new com.sun.star.beans.PropertyValue
  &#039;from http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options
  props(0).name = &quot;FilterName&quot;
  props(0).value = &quot;Text - txt - csv (StarCalc)&quot;
  props(1).name = &quot;FilterOptions&quot;
  props(1).value = &quot;9,34,0,1,&quot;
  doc = StarDesktop.loadComponentFromURL(url, &quot;_blank&quot;, 0, props)
  &#039; see http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html
  loadClusteringCSV = doc
end sub</description>
		<content:encoded><![CDATA[<p>OK;  here is what I wanted to use this for.  My input consist of lines like</p>
<p>sometextnumbernumber</p>
<p>where columns are separated by tabs, and cells may be padded by spaces.  In the Calc sheet I want to get rid of the spaces and have the numbers as numbers.</p>
<p>The macro I wanted to have is like:</p>
<p>sub main<br />
dim doc2 as object<br />
doc2 = loadClusteringCSV(&#8220;file:///input.txt&#8221;)<br />
end sub</p>
<p>sub loadClusteringCSV(byval url as string) as object<br />
  dim doc as object<br />
  dim props(1) as new com.sun.star.beans.PropertyValue<br />
  &#8216;from <a href="http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options" rel="nofollow">http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options</a><br />
  props(0).name = &#8220;FilterName&#8221;<br />
  props(0).value = &#8220;Text &#8211; txt &#8211; csv (StarCalc)&#8221;<br />
  props(1).name = &#8220;FilterOptions&#8221;<br />
  props(1).value = &#8220;9,34,0,1,&#8221;<br />
  doc = StarDesktop.loadComponentFromURL(url, &#8220;_blank&#8221;, 0, props)<br />
  &#8216; see <a href="http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html" rel="nofollow">http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html</a><br />
  loadClusteringCSV = doc<br />
end sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kohei Yoshida</title>
		<link>http://kohei.us/2009/06/09/csv-import-enhancement/comment-page-1/#comment-9699</link>
		<dc:creator>Kohei Yoshida</dc:creator>
		<pubDate>Wed, 30 Sep 2009 12:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://kohei.us/?p=486#comment-9699</guid>
		<description>Hi Gábor,

Actually, I&#039;m not sure if it&#039;s indeed working from macro.  If you could show me (either here or via email) a code snippet setting import options for csv document, I can take a look and see how it&#039;s working.  Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Gábor,</p>
<p>Actually, I&#8217;m not sure if it&#8217;s indeed working from macro.  If you could show me (either here or via email) a code snippet setting import options for csv document, I can take a look and see how it&#8217;s working.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gábor Németh</title>
		<link>http://kohei.us/2009/06/09/csv-import-enhancement/comment-page-1/#comment-9698</link>
		<dc:creator>Gábor Németh</dc:creator>
		<pubDate>Wed, 30 Sep 2009 12:15:43 +0000</pubDate>
		<guid isPermaLink="false">http://kohei.us/?p=486#comment-9698</guid>
		<description>Hi,

How can I enable the special numbers option from a macro?

Thanks,
Gábor</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>How can I enable the special numbers option from a macro?</p>
<p>Thanks,<br />
Gábor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Silvio</title>
		<link>http://kohei.us/2009/06/09/csv-import-enhancement/comment-page-1/#comment-9262</link>
		<dc:creator>Silvio</dc:creator>
		<pubDate>Tue, 09 Jun 2009 21:18:37 +0000</pubDate>
		<guid isPermaLink="false">http://kohei.us/?p=486#comment-9262</guid>
		<description>Hello Kohei,

Thanks a lot for your last improvements.
We import a lot of .csv files at work ;-)

Regards,

Silvio</description>
		<content:encoded><![CDATA[<p>Hello Kohei,</p>
<p>Thanks a lot for your last improvements.<br />
We import a lot of .csv files at work ;-)</p>
<p>Regards,</p>
<p>Silvio</p>
]]></content:encoded>
	</item>
</channel>
</rss>

