Saving txt data with . instead of , separator?

FNC

Member
Join Date
May 2010
Location
NJ
Posts
84
Hi,

I have a system that creates a text file that is comma delimited and it works great...in the US.

I installed it on a computer in Germany and the number 1.23 was now 1,23 which is a problem because it is imported by a program lokking for commas as a separator between values.

1.23,5.78 in Germany came out as 1,23,5,78 which screws up my import.

I went to Control Panel -> Region (sometimes called Region and Language) -> Additional settings and changed the decimal symbol to a "." but nothing changed. And yes I re-started the computer.

Is there a global windows value elsewhere that I need to change??
 
Each user has his own regional settings. So if the user is switched, your modification doesnt take effect.

I have this VB script in my Windows based HMIs (siemens WinCC Flexible and Siemens WinCC TIA).
It detects if the decimal point is wrong (and thus the list separator as well):
Code:
charDecPoint = Mid(CStr(8.1), 2, 1)If Not charDecPoint = "." Then 
	SmartTags("decimal_separator_wrong") = True
	ShowSystemAlarm "Decimal separator is wrong. Set decimal to '.', set list separator to ',' in Regional settings."
End If

This is then used to trigger a message and button to appear for the user to set the regional settings automatically via another VB script:
Code:
Dim shell

On Error Resume Next


Set shell = CreateObject("Wscript.shell")
shell.RegWrite "HKCU\Control Panel\International\sDecimal", ".", "REG_SZ"
shell.RegWrite "HKCU\Control Panel\International\sList", ",", "REG_SZ"


If Err.Number <> 0 Then
	ShowSystemAlarm "Error attempting to set the decimal separator set." & Err.Number & " " & Err.Description
    Err.Clear 
    Exit Sub
End If


SmartTags("decimal_separator_wrong") = False
SmartTags("decimal_separator_was_set") = True
ShowSystemAlarm "Decimal separator and list separator were set.\nIf the change does not take effect, then reboot the PC."


Set shell = Nothing
Usually, the user still have to restart Windows.
 
I am no longer in Germany and was hoping for a quick fix I could do over the phone with them.

I do not see why changing it in Control Panel -> Region doesn't fix it.
 

Similar Topics

Hello all, I need your help to understand, How can I save values in DB to a Txt file in each cycle. Hardware used: CPU317F-2 PN/DP HMI: MP...
Replies
4
Views
3,014
Hi everyone, i have an issue with saving a changed value in an AOI, I am using L84E, Everytime i try to save my work to SD card, the program lost...
Replies
1
Views
51
Hi all, I have installed a SICK AFM60A-S4IB018x12 encoder to Allen-Bradley CompactLogix PLC and configured its parameters via AOI provided by...
Replies
0
Views
82
Hello, i have a problem, i was trying to fix a trend that wasn't registering the tags, i got that fix by setting the path, but now i can get it to...
Replies
2
Views
766
I'm struggling with this...Times and Dates are always a mental-block for me. See picture. When I press SAVE, I want to take the current...
Replies
14
Views
1,540
Back
Top Bottom