DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

comma as decimal separator

Hello,
 
in my vb script I export channel data into a csv file with a "." as decimal separator. I´m using the datafilesave command.
How can I change decimal separator from "." to "," ?
 
Regards,
Marcel


Message Edited by Goju on 06-09-2008 06:32 AM
0 Kudos
Message 1 of 8
(7,365 Views)
Hello Goju,

you can use the key "decimalpoint", like

Call DATAFILESAVESEL("<filename>D:\temp\EXAMPLE.csv</filename><decimalpoint>,</decimalpoint>","CSV","'[1]/Time' - '[1]/Speed'")

Greetings
Walter
0 Kudos
Message 2 of 8
(7,341 Views)
Hello Walter,
 
thank you for the solution. It works!
 
Regards,
Marcel
0 Kudos
Message 3 of 8
(7,335 Views)

Interesting (hidden?) feature!!

Is there a way to specify the "Delimiter" & "NoValueSign" aswell?

And perhaps also to add a unitrow easy?

Regards

0 Kudos
Message 4 of 8
(7,309 Views)
Hello Sabcat,

I only know the way to specify the delimiter.
It´s the same way like to specify the decimal separator. But instead of using <decimalpoint> (see example from Walter) you have to use <delimiter>, e.g. <delimiter>;</delimiter>.

Regards
Marcel


0 Kudos
Message 5 of 8
(7,292 Views)

Hi Sabcat,

You can temporarily rename the first channel to create header rows above the channels and temporarily rename the last channel to create channel header rows, such as unit information, then rename the channels back to their original values after the CSV export.  It's low-tech, but it works, and uses the full efficiency of the CSV data export, which runs in C++ code.  I have attached an example VBScript below which does this programmatically.  You will need to edit the DataFileSave() line to include the extra XML from the other posts to get your custom delimiter and comma options.  I don't know of any way to affect the NoValue text.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

Message 6 of 8
(7,253 Views)