LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Language of installed MS-Office

Solved!
Go to solution
Hello folks, I have the following problem. My program has to create csv-files with measured data and read the data from the csv-files created with MS-Excel as well. Sure, it works with "write/read to/from spreadfile" very well, but we have MS-offices with different languages. The english one uses "." for decimal numbers and "," as delimeter the other one (german) "," for decimal numbers and ";" as delimeter. I need a VI returns the language of installed MS-Office, so I can choose the right delimeter. I found here this one (returns name of the computer) http://forums.ni.com/t5/LabVIEW/Get-Computer-Name/m-p/101433 I think it could work in similar way, but I don't know the registry of the installed MS-Office-language. Do you have any idea how to solve this problem ?! May be there is a simple one ?! (In Excel it is not possible the choose the delimeter (just "," in ENG-version and ";" in GER)). Thanks. With best regards: Alexander
0 Kudos
Message 1 of 13
(3,501 Views)

Why not use tab as delimeter?

But here is a clue

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 13
(3,489 Views)

Thank you for your VI but it doesn't help.

:

- Why not to use "tab"-delimeter ?

- the user creates a csv-file with Excel and it is not possible to choose tab-delimeter (there is just one defined delimeter in Excel (MS-2003) for .csv files)

....

I try to explane the problem again:

 

I need to determine the language of the installed MS-office to know if I have to use the ";" or "," as delimeter if I save a file.

(in the same way, I have to know if I have to use ";" or "," as delimeter, if the data should be read from the file.)

It is not possible to use "tab", because the Excel doesn't use it as delimeter in csv-files.

 

I hope the problem became clearer.

 

Cheers

 

0 Kudos
Message 3 of 13
(3,480 Views)

In Microsoft Excel you can choose to save the spreadsheet as a tab-delimited text file. Then you can change the extension to csv because csv is just a textfile with a special format.

 


@alexphysiker wrote:

Thank you for your VI but it doesn't help.

:

- Why not to use "tab"-delimeter ?

- the user creates a csv-file with Excel and it is not possible to choose tab-delimeter (there is just one defined delimeter in Excel (MS-2003) for .csv files)

....

I try to explane the problem again:

 

I need to determine the language of the installed MS-office to know if I have to use the ";" or "," as delimeter if I save a file.

(in the same way, I have to know if I have to use ";" or "," as delimeter, if the data should be read from the file.)

It is not possible to use "tab", because the Excel doesn't use it as delimeter in csv-files.

 

I hope the problem became clearer.

 

Cheers

 


 

0 Kudos
Message 4 of 13
(3,472 Views)

@ Coq Rouge

your VI is OK

 

Thanks.


0 Kudos
Message 5 of 13
(3,471 Views)
Solution
Accepted by topic author alexphysiker

@alexphysiker wrote:

It is not possible to use "tab", because the Excel doesn't use it as delimeter in csv-files.


That's only because you're choosing to use .csv. If you choose Text (tab delimited) as the file type then you can use tabs. A .csv file is nothing more than a text file anyway.

 

As for determining the language, a Google search would have yielded the answer. You can look in the registry for this information. For Office 2003 the key is HKLM\Software\Microsoft\Office\11.0\Common\LanguageResources\SKULanguage. The value of that key will tell you the language. English is 1033. Other languages have other values, which are documented.

0 Kudos
Message 6 of 13
(3,462 Views)

This setting is dependent on the configuration in "regional settings" in control panel. Both Labview and Excel use this settings. I live in a country that use "," as delimiter, and use XP in the same language.. But after some problems that really pissed me off. I changed to "." as delimiter. And also Excel can read  files using tab as delimiter. Tab is default for .txt files. Just Google "File format converters and Excel" and you will see. Do not create problems for your self. The VI I sent you will give you the information you need.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 13
(3,460 Views)

@smercurio_fc wrote:
As for determining the language, a Google search would have yielded the answer. You can look in the registry for this information. For Office 2003 the key is HKLM\Software\Microsoft\Office\11.0\Common\LanguageResources\SKULanguage. The value of that key will tell you the language. English is 1033. Other languages have other values, which are documented.

You can not determine which decimal sign the user have from the language used. My computer is one example. However this info is in the [HKEY_CURRENT_USER\Control Panel\International] and the key name is "sDecimal"

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 8 of 13
(3,448 Views)

@COq Rouge wrote:

@smercurio_fc wrote:
As for determining the language, a Google search would have yielded the answer. You can look in the registry for this information. For Office 2003 the key is HKLM\Software\Microsoft\Office\11.0\Common\LanguageResources\SKULanguage. The value of that key will tell you the language. English is 1033. Other languages have other values, which are documented.

You can not determine which decimal sign the user have from the language used. My computer is one example. However this info is in the [HKEY_CURRENT_USER\Control Panel\International] and the key name is "sDecimal"

 


True, but then the user was asking to determine the language only, which is what the answer is for. Smiley Wink

0 Kudos
Message 9 of 13
(3,440 Views)

@Isometric_fc wrote:
True, but then the user was asking to determine the language only, which is what the answer is for. Smiley Wink

 


 

Well everything is up to the OP now.  Let us hope he is busy doing coding

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 10 of 13
(3,430 Views)