Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread Desimal trouble
Mon, Oct 29 2012 12:39 PMPermanent Link

Thor Warberg

DBISAM 3.26 - D7.
Exporting Float fields from DBISAMtable to CSV works fine on integer.
If the fieldvalue contains desimals it comes out like text (left aligned in excel)
and values like ",042,50" in stead of "42,50".
What shall I do?
Thor
Tue, Oct 30 2012 8:19 AMPermanent Link

Uffe Kousgaard

It sounds like the export function is hardcoded to use , as field seperator,
but uses the regional settings for decimal seperator.

If that is so, you will have to change regional settings or it is impossible
to distinguish between comma's.

Or write your own CSV-export routine. Simple.

Regards
Uffe Kousgaard

<Thor Warberg> wrote in message
news:4CF04C03-2B73-4EEA-8FE9-2493C4849A66@news.elevatesoft.com...
> DBISAM 3.26 - D7.
> Exporting Float fields from DBISAMtable to CSV works fine on integer.
> If the fieldvalue contains desimals it comes out like text (left aligned
> in excel)
> and values like ",042,50" in stead of "42,50".
> What shall I do?
> Thor
>

Tue, Oct 30 2012 9:22 AMPermanent Link

Malcolm Taylor

Thor Warberg wrote:

> DBISAM 3.26 - D7.
> Exporting Float fields from DBISAMtable to CSV works fine on integer.
> If the fieldvalue contains desimals it comes out like text (left
> aligned in excel) and values like ",042,50" in stead of "42,50".
> What shall I do?
> Thor

Does it look like ",042,50" in the CSV file or is that what happens in
Excel?
Tue, Oct 30 2012 9:56 AMPermanent Link

Thor Warberg

"Uffe Kousgaard" wrote:

It sounds like the export function is hardcoded to use , as field seperator,
but uses the regional settings for decimal seperator.

If that is so, you will have to change regional settings or it is impossible
to distinguish between comma's.

Or write your own CSV-export routine. Simple.
@@
My routine goes like this via stringlist:
   StrL.add (Table2.fields(0).Astring + ';'+               ); All fields like AsString.
@@

Regards
Uffe Kousgaard

<Thor Warberg> wrote in message
news:4CF04C03-2B73-4EEA-8FE9-2493C4849A66@news.elevatesoft.com...
> DBISAM 3.26 - D7.
> Exporting Float fields from DBISAMtable to CSV works fine on integer.
> If the fieldvalue contains desimals it comes out like text (left aligned
> in excel)
> and values like ",042,50" in stead of "42,50".
> What shall I do?
> Thor
>
Tue, Oct 30 2012 9:59 AMPermanent Link

Thor Warberg

"Malcolm" wrote:

Thor Warberg wrote:

> DBISAM 3.26 - D7.
> Exporting Float fields from DBISAMtable to CSV works fine on integer.
> If the fieldvalue contains desimals it comes out like text (left
> aligned in excel) and values like ",042,50" in stead of "42,50".
> What shall I do?
> Thor

Does it look like ",042,50" in the CSV file or is that what happens in
Excel?
@@
Well, the values with desimals have become weird already
when the csv-file is opened in a text editor.
@@
Tue, Oct 30 2012 1:04 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Thor,

You can in fact change the separator character, for example:

EXPORT TABLE <YourTable> TO "c:\myfile.txt" DELIMITER ';' ...

--
Fernando Dias
[Team Elevate]
Tue, Oct 30 2012 6:30 PMPermanent Link

Thor Warberg

Fernando Dias wrote:

Thor,

You can in fact change the separator character, for example:

EXPORT TABLE <YourTable> TO "c:\myfile.txt" DELIMITER ';' ...

@@Excellent, Fernando.
      However, I already control the separator in the answer to Uffe Kousgaard.
      Thor

--
Fernando Dias
[Team Elevate]
Tue, Oct 30 2012 7:59 PMPermanent Link

Malcolm Taylor

Thor Warberg wrote:

> @@
> Well, the values with desimals have become weird already
> when the csv-file is opened in a text editor.
> @@

From what you told Uffe, I think the probblem is that you are not using
EXPORT but are navigating through the DataSet and using .AsString for
all field types.

If that is the case, you will either need to adjust your default format
settings or, as I do, use something like format() to control the
decimal strings.

To stop Excel treating them like strings, either do not wrap them in
double quotes, or change the column format in Excel after doing the
import.

Off topic:  
<rant> It is my belief that the CSV format was proposed on April 1 one
year by a few bored students who never thought they would be taken
seriously when they proposed as the separators and delimiters,
characters commonly occurring in text.

Personally, I never use " or , as delimiters and separators in my 'CSV'
files.  </rant>
Mon, Nov 5 2012 3:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Malcolm,

<< <rant> It is my belief that the CSV format was proposed on April 1 one
year by a few bored students who never thought they would be taken seriously
when they proposed as the separators and delimiters, characters commonly
occurring in text. >>

This is also my problem with regular expressions.  Yes, they're powerful,
but once you get done escaping everything that is a "special character", the
expressions are virtually unreadable by a human being with getting a
headache. Smile

Tim Young
Elevate Software
www.elevatesoft.com


Mon, Nov 5 2012 3:11 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Thor,

<< Exporting Float fields from DBISAMtable to CSV works fine on integer. If
the fieldvalue contains desimals it comes out like text (left aligned in
excel) and values like ",042,50" in stead of "42,50". >>

What does your ExportTable code look like ?

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image