static public GKCSVParser OpenFile(string filename, string columnStartMark, string filenameForDebug = "") { var p = new GKCSVParser(filename); p._filename = filenameForDebug; if (!string.IsNullOrEmpty(columnStartMark)) { while (p.NextRow()) { var n = p.CellCount; if (n <= 0) { continue; } if (p.GetCell(0).asString != columnStartMark) { continue; } for (int i = 1; i < n; i++) { var colName = p.GetCell(i).asString.Trim(); if (string.IsNullOrEmpty(colName)) { continue; } if (!p._columnIndexByName.ContainsKey(colName)) { p._columnIndexByName.Add(colName, i); } else { Debug.LogError(string.Format("Add columnIndexByName Key: {0}, Value: {1}", colName, i)); } } return(p); } Debug.LogError("Cannot find columnStartMask " + filenameForDebug); return(null); } return(p); }
public Cell(GKCSVParser p) { p_ = p; }