how? read a xls from unity with java or c #?

//English****************

hello such nesesito read a file excel xls from unity to take the values and add either a settlement or be reading them constantly minds wanted to know and see if you could do or where can I read something to help me get thanks in advance :slight_smile:

//----------Español--------------------------

hello que tal nesesito leer un archivo de excel xls desde unity para tomar valores de el y agregarlos ya sea a un arreglo o estar leyendolos constante mente queria ver si sabian como se podria hacer o donde puedo leer algo que me ayude a consegirlo gracias de antemano :slight_smile:

The (I assume) machine translation is pretty bad, so I can only hope I understood right.

XLS files are very complex. Instead, you should use Excel to export to .CSV files which are much easier to read in code.

Then you would load the file with something like this:

function Load(file : String) : String {
	if(File.Exists(file)){
		var sr = File.OpenText(file);
		var text : String = "";
		var line = sr.ReadLine();
		while(line != null){
			text += line+"\n";
			line = sr.ReadLine();
		}
		return text;
	}
	else {
		Debug.Log("Could not Open the file: " + file + " for reading.");
		return;
	}

}

var csv : String = Load("somefile.csv");
var lines : String[] = csv.Split("\n"[0]);
for (l=0;l<lines.length;l++) {
var cells : String[] = lines[l].Split(","[0]);
//process your cells here
someData[l].firstCell = cells[0];
someData[l].secondCell = cells[1];
}