static public CSVTable.CSVItem[] Load(string fileName) { CSVTable.CSVItem[] items = null; try { CSVReader csv = new CSVReader(fileName); List<string> tables = csv.ReadLineAsList(); int length = tables.Count; if (length > 0) { items = new CSVTable.CSVItem[length]; int count = 0; for (; csv.Ready(); ) { items[count] = new CSVTable.CSVItem(); string[] value_ren = csv.ReadLineAsArray(); for (int i = 0; i < length; i++) { items[count].Put(tables[i], value_ren[i]); items[count].index = i; } count++; } } if (csv != null) { csv.Close(); csv = null; } } catch (IOException ex) { Loon.Utils.Debug.Log.Exception(ex); } return items; }
public CSVReader(string fileName, string charsetName) { reader = CSVReader.Reader(fileName, charsetName); }
public CSVReader(string fileName) { reader = CSVReader.Reader(fileName, LSystem.encoding); }