Hi there,
I'm trying to import a csv file into my MySQL database. Unfortunately the
number format for the price column is formatted in German style, i.e. XX,XX
(decimals separated by comma not by dot). When importing this file using
LOAD DATA LOCAL INFILE the decimals are cut off. I'm using column type FLOAT
for the price column in my database.
Is there any chance to preserve the decimals when importing the csv file
into my database even though the format differs from the one MySQL needs
(dot versus comma)? Is it possible to adjust the query to include this or
how can I achieve this?
My current query looks like this:
$query = mysql_query("LO AD DATA LOCAL INFILE '$file' INTO TABLE $data_table
FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;");
Thanks for any help!
---
Andreas 2 8706
Andreas Emmert wrote: Hi there,
I'm trying to import a csv file into my MySQL database. Unfortunately the number format for the price column is formatted in German style, i.e. XX,XX (decimals separated by comma not by dot). When importing this file using LOAD DATA LOCAL INFILE the decimals are cut off. I'm using column type FLOAT for the price column in my database.
Is there any chance to preserve the decimals when importing the csv file into my database even though the format differs from the one MySQL needs (dot versus comma)? Is it possible to adjust the query to include this or how can I achieve this?
Can't you simply write a 3 or 4-line perl script to convert the file into
the appropriate format?
-Fred
--
Shameless plug: http://JobMarketIntelligence.com
A database of high-tech firms at your fingertips.
Good idea, I'll try to do this and run the file through such a filter first
before inserting everything into the database ... simple solutions are best
:)
--
Andreas
"Fred" <fr**@jobmarket intelligence.co m> schrieb im Newsbeitrag
news:ktu3b.2890 81$uu5.63240@sc crnsc04... Andreas Emmert wrote:
Hi there,
I'm trying to import a csv file into my MySQL database. Unfortunately
the number format for the price column is formatted in German style, i.e. XX,XX (decimals separated by comma not by dot). When importing this file using LOAD DATA LOCAL INFILE the decimals are cut off. I'm using column type FLOAT for the price column in my database.
Is there any chance to preserve the decimals when importing the csv file into my database even though the format differs from the one MySQL needs (dot versus comma)? Is it possible to adjust the query to include this
or how can I achieve this?
Can't you simply write a 3 or 4-line perl script to convert the file into the appropriate format?
-Fred
-- Shameless plug: http://JobMarketIntelligence.com A database of high-tech firms at your fingertips. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: simon |
last post by:
I have virtual directory where I run test.asp page with only this code
inside:
<%Response.Write now()%>
As a result, if I go into the IE and browse for the test.asp page, I get :
1/22/2004 14:18:04
If I copy this page on some other(existing) virtual directory, I get as a
result
22.1.2004 14:19:06
|
by: mikey |
last post by:
Hi all,
I'm having great problems trying to install the latest MySQl RPM
package onto my Red Hat Linux OS.
There is already MySQL v 3.0 pre-installed with the RH Linux
distribution disk but I can not seem to get any of the functions
working on it. So I have now dopwnloaded the latest version hoping
that this will fix the error.
I have managed to install the MySQL-shared-compat-4.0.1-0.i386.rpm but
|
by: johkar |
last post by:
My XML and XSL is below. Also below is a textual representation of what I
want to get out of the XML with XSL. For each Extension node in XML, I am
only concerned with those nodes with fieldTypeCodes of 10 - 17. For any
given query there will be up to 4 Extension nodes fitting this criteria. I
have everything working except for being able to insert a, b, c or d in the
<box12 tags. Notice each row or found node has a different letter. ...
|
by: Peter Eisentraut |
last post by:
Greetings.
The official PostgreSQL documentation has been translated to German and
has been published as a book by verlag moderne industrie/mitp
("PostgreSQL: Das offizielle Handbuch", ISBN 3-8266-1337-6, see
<http://www.mitp.de/vmi/mitp/detail/pWert/1337>). I am the translator of
this work, but let me assure you I don't get any additional money
depending on how much it sells. On the other hand, the publisher has
assured me that a...
|
by: Eric |
last post by:
Hi,
Normally I'm developing evertime with the english versions of Win, VS.NET,
..NET etc.
But know I have a german Win XP SP1 with IIS 5.1 installed.
Anyway I would like to develop with english versions.
Because of that I installed the english version of VS.NET.
| |
by: Sick |
last post by:
My application populates a ListBox from a .TXT file. In the textfile there
are prices with both dots as well as comma's for decimal indication.
Example:
1234990; xg-tr-45; 1700,50; 0
2662666; hj-54-56; 1565.00; 0
8228880; 30-56-tw; 3295.50; 0
0022339; hs-sa-73; 2975,75; 0
.... etc
|
by: Markus Wollny |
last post by:
Hi!
Sorry to bother you, but I just don't know how to get tsearch2 configured correctly for my setup. I've got a 7.4.3 database-cluster initdb'ed with de_DE@euro as locale, the database is with Unicode encoding.
I made and installed contrib/tsearch2 after installing the dump/reload-patch http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/regprocedure_7.4.patch.gz as advised by the docs. So far everything is looking good, I have...
|
by: news.online.de |
last post by:
Hello everybody,
probably it's a FAQ but I didn't find anything so far concerning my problem,
so I am asking here :-)
I am facing the following problem:
- I have developed a webservice client to an axis service on a german
windows system with a german VS.net 2002
- If I have german special characters (Umlaute äöü...) in a string variable
everything works fine on the german system, but if a install the client on
an english system the...
|
by: andreas |
last post by:
When I copy a vb.net project using date formats from one PC with a windows
date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I
get errors.
How can I change for a while in the project the date format in vb.code (
not in Windows) and how can I find out which date format the PC Windows is
using.
Thanks for any response
|
by: ivan |
last post by:
hi all,
if I have:
if(A && B || C)
which operation gets executed first?
If I remeber well should be &&, am I correct?
thanks
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |