[AccessD] CSV and currency symbols

Gustav Brock gustav at cactus.dk
Tue Oct 14 14:38:52 CDT 2008


Hi Andy

Then you'll have to create some kind of profile for each source to define how to handle the import.
The easiest method is to read each record into a string array and then - using the current profile - convert this to an interim format which you then can have a common routine to pass to your database table(s).

/gustav

>>> andy at minstersystems.co.uk 14-10-2008 18:03 >>>
Hi Gustav, thanks as always for your input

The CSV files are coming from a variety of systems. They are finacial
reports from accounting systems at multiple sites, and different sites have
different accounting systems. They're also packages so the sites generating
the reports have limited flexibility. They can choose the package's "Output
to CSV" option but generally not much more.

So I have to handle this in my Access stuff that is going to receive the
data and analyse it.

Andy Lacey
http://www.minstersystems.co.uk 



--------- Original Message --------
From: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
To: "accessd at databaseadvisors.com" <accessd at databaseadvisors.com>
Subject: Re: [AccessD] CSV and currency symbols
Date: 14/10/08 15:52


Hi Andy

One method is to save the amounts * 100 as integers and divide by 100 when
reading. Many mainframe systems do this.

Another is to take control in your code and always save with dot as decimal
separator and assume that as well when reading.
This is very easy to perform:
Use LTrim(Str(curAmount)) for writing the string and Val(strAmount) for
reading.

/gustav

>>> andy at minstersystems.co.uk 14-10-2008 17:16:38 >>>
Hi to the internationalists

Before I cook something up myself has anyone already done this?

I'm writing a system that will be run in France but will take data produced
in CSV files in the UK as wel as on the continent. This means that a CSV
file produced in UK will output a number as, eg, 123.45 whereas one in
France will write 123,45. So I guess I'll have to read everything into a
text field and parse it to write out a number in whichever is the local
format (France as I say, but who knows if someone may decide to run it in
UK).

Anyone handled this situation and have any useful bits & pieces?

--
Andy Lacey
http://www.minstersystems.co.uk 






More information about the AccessD mailing list