A multinational client needs to be able to import CSV files via an Ignition project. All works well when the CSV is created (via Excel) and imported in the US. The issues occur when the CSV is created and imported in Europe. Following is the code I am using to open the file:
if system.util.getLocale()[:2] == 'en': csv_data = csv.reader(open(path, 'rb')) else: csv_data = csv.reader(open(path, 'rb'), delimiter=';')
Any assistance with the following questions is greatly appreciated:
- Is there a preferred method for dealing with commas used as decimal separators in floating point numbers?
- Is there a better method for opening the file?