Help exporting a CSV file

i’m exporting a report to a CSV file, i need to open this file in excel, the things is, it exports fine, but when i open the file, the information is all in one column, the “,” is not separating the text

what do i need to do?

This isnt really a place to ask general code questions unfortunately. CSVs are truly an awful format I suggest avoiding unless necessary.


Regardless, you may want to check your delimiter/ separator settings in excel.

Just to get the obvious out of the way first, what filetype are you creating? For example are you creating a file called “mydata.csv” or “mydata.xls”?

The following writes out a valid CSV in your current project directory. It opens correctly in Excel:

using System.IO;
using UnityEngine;

public class Test : MonoBehaviour
{
	void Start()
	{
		StreamWriter sw = new StreamWriter("table.csv");

		sw.WriteLine("A, 1, B, 2, C, 3");
		sw.Close();
	}
}

Already found a way to fix it! Thanks any way, it was a windows bug