<?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: MySQL import (or: How I found the LazyWeb)</title>
	<atom:link href="http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/</link>
	<description>Dave Neary's view of the world</description>
	<lastBuildDate>Sun, 11 Dec 2011 14:17:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Stuart Langridge</title>
		<link>http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/comment-page-1/#comment-94</link>
		<dc:creator>Stuart Langridge</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/#comment-94</guid>
		<description>I assume that chucking the file through sed &#039;s/\([0-9]*; *-*[0-9]*\),\([0-9]*;\)/\1.\2/&#039; is unavailable for some reason?</description>
		<content:encoded><![CDATA[<p>I assume that chucking the file through sed &#8216;s/\([0-9]*; *-*[0-9]*\),\([0-9]*;\)/\1.\2/&#8217; is unavailable for some reason?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raphaël Quinet</title>
		<link>http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/comment-page-1/#comment-95</link>
		<dc:creator>Raphaël Quinet</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/#comment-95</guid>
		<description>&lt;p&gt;The mysqlimport tool is only sending the SQL command LOAD DATA INFILE... to the MySQL server.  Changing LC_NUMERIC on the client side should have no effect.  And you probably do not want to change LC_NUMERIC on the server side, so the best way is probably to transform the input file as suggested in the previous comment.&lt;/p&gt;&lt;p/&gt;&lt;p&gt;If floating-point numbers can occur in any column, the substitution can be done with: &#039;s/\([0-9]+\),\([0-9]+\)/\1.\2/&#039;&lt;/p&gt;&lt;br/&gt;</description>
		<content:encoded><![CDATA[<p>The mysqlimport tool is only sending the SQL command LOAD DATA INFILE&#8230; to the MySQL server.  Changing LC_NUMERIC on the client side should have no effect.  And you probably do not want to change LC_NUMERIC on the server side, so the best way is probably to transform the input file as suggested in the previous comment.</p>
<p />
<p>If floating-point numbers can occur in any column, the substitution can be done with: &#8216;s/\([0-9]+\),\([0-9]+\)/\1.\2/&#8217;</p>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Neary</title>
		<link>http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/comment-page-1/#comment-96</link>
		<dc:creator>Dave Neary</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/#comment-96</guid>
		<description>&lt;br/&gt;the s/,/. trick doesn&#039;t work because the database has a bucketload of numeric CSV fields like &quot;12,15,32,18&quot; to represent lists of numbers (don&#039;t get me started).&lt;p/&gt;It looks like the easiest thing to do is to redo the dump (ech!) with &lt;p/&gt;alter session set NLS_NUMERIC_CHARACTERS=&quot;.,&quot;&lt;p/&gt;&lt;br/&gt;I also needed to add --fields-escaped-by=&#039;&#039; since Oracle doesn&#039;t quote fields or escape characters in there, and some text fields used ; as a separator.&lt;br/&gt;</description>
		<content:encoded><![CDATA[<p>the s/,/. trick doesn&#8217;t work because the database has a bucketload of numeric CSV fields like &#8220;12,15,32,18&#8243; to represent lists of numbers (don&#8217;t get me started).
<p />It looks like the easiest thing to do is to redo the dump (ech!) with
<p />alter session set NLS_NUMERIC_CHARACTERS=&#8221;.,&#8221;
<p />I also needed to add &#8211;fields-escaped-by=&#8221; since Oracle doesn&#8217;t quote fields or escape characters in there, and some text fields used ; as a separator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Neary</title>
		<link>http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/comment-page-1/#comment-97</link>
		<dc:creator>Dave Neary</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/#comment-97</guid>
		<description>&lt;br/&gt;Alternatively, starting the server in French mode, doing the import, then restarting it in English mode is an option. Will try that (thanks for the idea, Rapha&#235;l).</description>
		<content:encoded><![CDATA[<p>Alternatively, starting the server in French mode, doing the import, then restarting it in English mode is an option. Will try that (thanks for the idea, Rapha&euml;l).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared Sulem</title>
		<link>http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/comment-page-1/#comment-98</link>
		<dc:creator>Jared Sulem</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/#comment-98</guid>
		<description>You could try the following program to convert floating fields seperated with commas, into fields seperating with decimal points.  Input and output is from/to standard input and standard output.&lt;p/&gt;----&lt;br/&gt;#!/usr/bin/env python&lt;p/&gt;import sys&lt;br/&gt;import re&lt;br/&gt;import csv&lt;p/&gt;if __name__ == &quot;__main__&quot;:&lt;br/&gt;        reader = csv.reader(sys.stdin, delimiter = &quot;;&quot;)&lt;br/&gt;        writer = csv.writer(sys.stdout, delimiter = &quot;;&quot;)&lt;br/&gt;        &lt;br/&gt;        fre = re.compile(&quot;^(\s*[0-9]*),([0-9]*\s*)$&quot;)&lt;br/&gt;        &lt;br/&gt;        for row in reader:&lt;br/&gt;                newrow = ()&lt;br/&gt;                for field in row:&lt;br/&gt;                        match = fre.match(str(field))&lt;br/&gt;                        if match:&lt;br/&gt;                                newrow = newrow + (match.group(1) + &quot;.&quot; + match.group(2), )&lt;br/&gt;                        else:&lt;br/&gt;                                newrow = newrow + (field, )&lt;br/&gt;                        &lt;br/&gt;                writer.writerow(newrow)&lt;br/&gt;</description>
		<content:encoded><![CDATA[<p>You could try the following program to convert floating fields seperated with commas, into fields seperating with decimal points.  Input and output is from/to standard input and standard output.
<p />&#8212;-<br />#!/usr/bin/env python
<p />import sys<br />import re<br />import csv
<p />if __name__ == &#8220;__main__&#8221;:<br />        reader = csv.reader(sys.stdin, delimiter = &#8220;;&#8221;)<br />        writer = csv.writer(sys.stdout, delimiter = &#8220;;&#8221;)</p>
<p>        fre = re.compile(&#8220;^(\s*[0-9]*),([0-9]*\s*)$&#8221;)</p>
<p>        for row in reader:<br />                newrow = ()<br />                for field in row:<br />                        match = fre.match(str(field))<br />                        if match:<br />                                newrow = newrow + (match.group(1) + &#8220;.&#8221; + match.group(2), )<br />                        else:<br />                                newrow = newrow + (field, )</p>
<p>                writer.writerow(newrow)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared Sulem</title>
		<link>http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/comment-page-1/#comment-99</link>
		<dc:creator>Jared Sulem</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/#comment-99</guid>
		<description>It might be best to copy the program in the previous comment from the source HTML, since the tabs are lost in the browser rendering.</description>
		<content:encoded><![CDATA[<p>It might be best to copy the program in the previous comment from the source HTML, since the tabs are lost in the browser rendering.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raphaël Quinet</title>
		<link>http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/comment-page-1/#comment-100</link>
		<dc:creator>Raphaël Quinet</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/#comment-100</guid>
		<description>&lt;p&gt;If the database output uses commas as decimal separators and uses the same character for separating list elements, then it is asking for trouble.&lt;/p&gt;&lt;p/&gt;&lt;p&gt;But these two meanings for the comma are almost certainly occurring in different columns, so the s/,/./ trick can still be used as suggested by Stuart Langridge: make sure that your regexp only matches the column in which the replacements should be made.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>If the database output uses commas as decimal separators and uses the same character for separating list elements, then it is asking for trouble.</p>
<p />
<p>But these two meanings for the comma are almost certainly occurring in different columns, so the s/,/./ trick can still be used as suggested by Stuart Langridge: make sure that your regexp only matches the column in which the replacements should be made.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  blogs.gnome.org/bolsh/2005/12/13/mysql-import-or-how-i-found-the-lazyweb/feed/ ) in 1.20622 seconds, on Feb 11th, 2012 at 7:30 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 11th, 2012 at 8:30 am UTC -->
