Closed JAQuent closed 3 months ago
I found the issue: it seems that somewhere in the process from downloading the .csv file to splitting it by rows a \r
was added to each end of line this a) let to the error I described above but also b) that the .csv data is not saved correctly so that the columns copied from the table and the trial results added during the the experiment are split into two rows. This let me to investigate whether there are still new line characters in the strings. I now simply replace each '\r` with an empty string:
string csvText = www.downloadHandler.text;
string[] csvLines = csvText.Split("\n");
// Loop through the lines
for (int i = 0; i < csvLines.Length; i++){
csvLines[i] = csvLines[i].Replace("\r", String.Empty);
}
// parse as table
UXFDataTable table = UXFDataTable.FromCSV(csvLines);
For a WebGL experiment I created a method to download .csv files and build the experiment from the table:
However, there is this super odd bug that when I try to access the last column of the .csv e.g.
trial.settings.GetFloat("hello")
,I get the following error message:However,
hello
is in the session debugger:The problem disappears when I add a dummy column that doesn't matter, so this column can't be accessed by
trial.settings.GetFloat("dummy")
buthello
can.