private IEnumerator load1(string url, string key, OnValues1 cb) { yield return(load(url, (string text) => { var dic = new Dictionary <int, CsvValue>(); string[] keys = null; using (StringReader sr = new StringReader(text)) { string line; bool is_head_line = true; while ((line = sr.ReadLine()) != null) { if (is_head_line) { is_head_line = false; keys = line2items(line); } else { var csv_value = new CsvValue(); csv_value.parseLine( Path.GetFileName(url), keys, line2items(line)); csv_value.findKey(key); dic[csv_value.key] = csv_value; } } } cb(dic); })); }
public void parse1(string url, string key, OnValues1 cb) { StartCoroutine(load1(url, key, cb)); }