Changing csv format #99
-
Hello! I am currently collecting data with this great framework but unfortunately it saves it seperated with ';' and floats with ',' in a csv. I would prefer a data collection with ',' instead of ',' and '.' instead of ',' because I want to analyse it computationally. I read that this is becaue I use it from a non english location but where can I change this behavior in the code? Couldn't finde an answer yet. Greetings |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi! I think the most straightforward way is to change the language / localisation of the PC you are running Unity on to English. Secondly I imagine most CSV reading software (Python, R, MATLAB) supports using delimiters of Another way (untested) is to change the locale of your program using code. For example, you can write a simple script that forces to English locale on Awake() using something this, and attach it to an object in your scene: using UnityEngine;
using System.Globalization;
using System.Threading;
public class CultureSetter : MonoBehaviour
{
private void Awake()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
}
} |
Beta Was this translation helpful? Give feedback.
Hi! I think the most straightforward way is to change the language / localisation of the PC you are running Unity on to English.
Secondly I imagine most CSV reading software (Python, R, MATLAB) supports using delimiters of
;
. Commas are not necessary.Another way (untested) is to change the locale of your program using code. For example, you can write a simple script that forces to English locale on Awake() using something this, and attach it to an object in your scene: