CsvToLua.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.IO;
  5. using UnityEditor;
  6. using System.Text;
  7. using System;
  8. using Game.Config;
  9. using RO.Editor;
  10. using LuaInterface;
  11. using System.Linq;
  12. using System.Text.RegularExpressions;
  13. public class CfgLanguageCfg : GameData<CfgLanguageCfg>
  14. {
  15. public string CfgName;
  16. public string Field;
  17. public string CfgID;
  18. public int CfgType;
  19. public int Enable;
  20. public CfgLanguageCfg()
  21. {
  22. CfgName = "";
  23. Field = "";
  24. CfgID = "";
  25. CfgType = 0;
  26. Enable = 0;
  27. }
  28. public static void OnCsvLoad(CsvReader csvReader)
  29. {
  30. CfgLanguageCfg.Onload(csvReader);
  31. }
  32. public static string FileName_S()
  33. {
  34. return "";
  35. }
  36. }
  37. public class LanguageCfg : GameData<LanguageCfg>
  38. {
  39. public string key;
  40. public string Language;
  41. public LanguageCfg()
  42. {
  43. key = "";
  44. Language = "";
  45. }
  46. public static void OnCsvLoad(CsvReader csvReader)
  47. {
  48. LanguageCfg.Onload(csvReader);
  49. }
  50. public static string FileName_S()
  51. {
  52. return "";
  53. }
  54. }
  55. public class CsvToLua : EditorWindow
  56. {
  57. public static string CSV_PATH = "csv path";
  58. public static string LUA_PATH = "lua path";
  59. public static string START_LINE = "start line";
  60. public string tableDirectoryName;
  61. public string luaDirectoryName;
  62. public int startDataLine = 1;
  63. public static bool IsObj;
  64. [MenuItem("Tools/CsvToLua")]
  65. static void Init()
  66. {
  67. CsvToLua window = (CsvToLua)GetWindow(typeof(CsvToLua));
  68. window.Show();
  69. }
  70. void OnEnable()
  71. {
  72. tableDirectoryName = EditorPrefs.GetString(CSV_PATH);
  73. luaDirectoryName = EditorPrefs.GetString(LUA_PATH);
  74. startDataLine = EditorPrefs.GetInt(START_LINE);
  75. }
  76. void OnDisable()
  77. {
  78. EditorPrefs.SetString(CSV_PATH, tableDirectoryName);
  79. EditorPrefs.SetString(LUA_PATH, luaDirectoryName);
  80. EditorPrefs.SetInt(START_LINE, startDataLine);
  81. }
  82. private void OnGUI()
  83. {
  84. GUILayout.Label("Base Settings", EditorStyles.boldLabel);
  85. EditorGUILayout.BeginHorizontal();
  86. tableDirectoryName = EditorGUILayout.TextField("TableDirectory Name", tableDirectoryName);
  87. if (GUILayout.Button("选择csv路径", GUILayout.Width(200)))
  88. {
  89. tableDirectoryName = GetFilePath();
  90. }
  91. EditorGUILayout.EndHorizontal();
  92. EditorGUILayout.BeginHorizontal();
  93. luaDirectoryName = EditorGUILayout.TextField("LuaDirectory Name", luaDirectoryName);
  94. if (GUILayout.Button("选择到处table路径", GUILayout.Width(200)))
  95. {
  96. luaDirectoryName = GetFilePath();
  97. }
  98. EditorGUILayout.EndHorizontal();
  99. startDataLine = EditorGUILayout.IntField("StartDataLine", startDataLine);
  100. if (GUILayout.Button("CsvToLua"))
  101. Change();
  102. if (GUILayout.Button("测试"))
  103. {
  104. string lua = @"local aaa =
  105. {
  106. [1] =
  107. {
  108. ['a'] = 1,
  109. ['b'] = '2',
  110. ['c'] = 'asd' ,
  111. ['d'] = {1,2,3,{{1,2},{3,4},{1.2,0},{0}}},
  112. ['aId'] = 1,
  113. } ,
  114. }
  115. return aaa";
  116. using (LuaState runTime = new LuaState())
  117. {
  118. runTime.Start();
  119. //LuaState runTime = LuaClient.Instance.luaState;
  120. runTime.DoFile("Assets\\Editor\\CsvToLua\\table-save.lua");
  121. LuaTable luaTable = runTime.DoString<LuaTable>(lua);
  122. RolePreviewWindow.SaveToLua(runTime, "aaa.lua", luaTable, "AAA","");
  123. }
  124. }
  125. if (GUILayout.Button("检查"))
  126. {
  127. CheckCgf();
  128. }
  129. IsObj = GUILayout.Toggle(IsObj,"运行时启动");
  130. if (GUILayout.Button("更改CardCfg"))
  131. {
  132. ChangeLuaCfg("Assets/Lua/Config/CardCfg.lua", "Assets\\Editor\\CsvToLua\\LuaCfg.lua", "Build/NewCfg/CardCfg.lua");
  133. }
  134. }
  135. public static string GetFilePath()
  136. {
  137. OpenDialogDir ofn2 = new OpenDialogDir();
  138. ofn2.pszDisplayName = new string(new char[2000]); ; // 存放目录路径缓冲区
  139. ofn2.lpszTitle = "Open Project";// 标题
  140. //ofn2.ulFlags = BIF_NEWDIALOGSTYLE | BIF_EDITBOX; // 新的样式,带编辑框
  141. IntPtr pidlPtr = DllOpenFileDialog.SHBrowseForFolder(ofn2);
  142. char[] charArray = new char[2000];
  143. for (int i = 0; i < 2000; i++)
  144. charArray[i] = '\0';
  145. DllOpenFileDialog.SHGetPathFromIDList(pidlPtr, charArray);
  146. string fullDirPath = new String(charArray);
  147. fullDirPath = fullDirPath.Substring(0, fullDirPath.IndexOf('\0'));
  148. return fullDirPath;
  149. }
  150. public void Change()
  151. {
  152. Debug.Log(tableDirectoryName);
  153. foreach (var item in Directory.GetFiles(tableDirectoryName))
  154. {
  155. if (item.Contains(".meta"))
  156. continue;
  157. CreatLuaTable(item);
  158. }
  159. }
  160. void CreatLuaTable(string filePath)
  161. {
  162. CreatDirectory();
  163. Save(GetSavePath(filePath), GetSaveContext(filePath));
  164. }
  165. void CreatDirectory()
  166. {
  167. string path = luaDirectoryName;
  168. if (!Directory.Exists(path))
  169. {
  170. Directory.CreateDirectory(path);
  171. AssetDatabase.Refresh();
  172. }
  173. }
  174. string GetSavePath(string filePath)
  175. {
  176. string fileName = GetFileName(filePath);
  177. return luaDirectoryName + "/" + fileName + ".lua";
  178. }
  179. string GetFileName(string filePath)
  180. {
  181. string targetPath = filePath.Replace(@"\", "/");
  182. string[] strs = targetPath.Split('/');
  183. targetPath = strs[strs.Length - 1];
  184. strs = targetPath.Split('.');
  185. string fileName = strs[0];
  186. return fileName;
  187. }
  188. string GetSaveContext(string filePath)
  189. {
  190. string fileName = GetFileName(filePath);
  191. List<string> context = GetContext(filePath);
  192. string[] propertyName = GetPropertyName(context[1]);
  193. string[] typeName = GetPropertyName(context[2]);
  194. StringBuilder sb = new StringBuilder();
  195. sb.Append("local " + fileName + " = {" + "\n");
  196. for (int i = startDataLine; i < context.Count; i++)
  197. {
  198. context[i] = context[i].Replace(" ", "");
  199. string[] details = context[i].Split(',');
  200. sb.Append("[" + details[0] + "]={" + "\n");
  201. for (int j = 0; j < propertyName.Length; j++)
  202. {
  203. sb.Append("['" + propertyName[j] + "']=");
  204. if (typeName[j].Equals("string"))
  205. sb.Append("'" + details[j] + "'," + "\n");
  206. else if (typeName[j].Equals("bool"))
  207. {
  208. sb.Append(details[j].ToLower() + "," + "\n");
  209. }
  210. else if (typeName[j].Equals("list"))
  211. {
  212. if (details[j].IndexOf(';') > 0)
  213. {
  214. ParseTable(sb, details[j], ';');
  215. }
  216. else if (details[j].IndexOf(':') > 0 && details[j].IndexOf(';') < 0)
  217. {
  218. sb.Append("{");
  219. ParseTable(sb, details[j], ':');
  220. sb.Append("}");
  221. }
  222. else
  223. {
  224. sb.Append("{");
  225. try
  226. {
  227. if (details[j].IndexOf('.') > 0)
  228. {
  229. Convert.ToDouble(details[j]);
  230. }
  231. else
  232. {
  233. Convert.ToInt32(details[j]);
  234. }
  235. sb.Append(details[j]);
  236. }
  237. catch
  238. {
  239. if (!string.IsNullOrEmpty(details[j]))
  240. sb.Append("'" + details[j] + "'");
  241. }
  242. sb.Append("}");
  243. }
  244. sb.Append(",\n");
  245. }
  246. else if (typeName[j].Equals("enum"))
  247. {
  248. sb.Append("Enum." + propertyName[j] + "." + details[j] + "," + "\n");
  249. }
  250. else
  251. {
  252. string num = "0";
  253. if (details[j] != "")
  254. {
  255. num = details[j];
  256. }
  257. sb.Append(num + "," + "\n");
  258. }
  259. }
  260. sb.Append("}," + "\n");
  261. }
  262. sb.Append("}" + "\n");
  263. sb.Append("return " + fileName);
  264. return sb.ToString();
  265. }
  266. void ParseTable(StringBuilder sb, string content, char split)
  267. {
  268. string[] strs = content.Split(split);
  269. sb.Append("{");
  270. for (int m = 0; m < strs.Length; ++m)
  271. {
  272. try
  273. {
  274. if (strs[m].IndexOf(':') > 0)
  275. {
  276. ParseTable(sb, strs[m], ':');
  277. }
  278. else
  279. {
  280. if (strs[m].IndexOf('.') > 0)
  281. {
  282. Convert.ToDouble(strs[m]);
  283. }
  284. else
  285. {
  286. Convert.ToInt32(strs[m]);
  287. }
  288. sb.Append(strs[m]);
  289. }
  290. }
  291. catch
  292. {
  293. if (!string.IsNullOrEmpty(strs[m]))
  294. sb.Append("'" + strs[m] + "'");
  295. }
  296. if (m < strs.Length - 1)
  297. {
  298. sb.Append(",");
  299. }
  300. }
  301. sb.Append("}");
  302. }
  303. List<string> GetContext(string filePath)
  304. {
  305. StreamReader sr = new StreamReader(filePath);
  306. List<string> contexts = new List<string>();
  307. string line;
  308. while ((line = sr.ReadLine()) != null)
  309. contexts.Add(line);
  310. return contexts;
  311. }
  312. string[] GetPropertyName(string line)
  313. {
  314. string[] names = line.Split(',');
  315. return names;
  316. }
  317. void Save(string path, string information)
  318. {
  319. if (File.Exists(path))
  320. File.Delete(path);
  321. FileStream aFile = new FileStream(@"" + path, FileMode.OpenOrCreate, FileAccess.ReadWrite);
  322. StreamWriter sw = new StreamWriter(aFile);
  323. sw.Write(information);
  324. sw.Close();
  325. sw.Dispose();
  326. aFile.Close();
  327. aFile.Dispose();
  328. sw = null;
  329. aFile = null;
  330. AssetDatabase.Refresh();
  331. }
  332. public static Dictionary<string, List<CfgLanguageCfg>> GetCfgLanguageCfg(string path)
  333. {
  334. Dictionary<string, List<CfgLanguageCfg>> ret = new Dictionary<string, List<CfgLanguageCfg>>();
  335. TextAsset ta = AssetDatabase.LoadAssetAtPath<TextAsset>(path);
  336. CsvReader csvReader = new CsvReader(CfgLanguageCfg.FileName_S(), ta.bytes);
  337. CfgLanguageCfg.OnCsvLoad(csvReader);
  338. CfgLanguageCfg.Foreach(it =>
  339. {
  340. if (it.Enable == 0)
  341. {
  342. return;
  343. }
  344. if (ret.ContainsKey(it.CfgName))
  345. {
  346. ret[it.CfgName].Add(it);
  347. }
  348. else
  349. {
  350. List<CfgLanguageCfg> cfgs = new List<CfgLanguageCfg>();
  351. cfgs.Add(it);
  352. ret.Add(it.CfgName,cfgs);
  353. }
  354. //Debug.Log(it.BaseName);
  355. });
  356. CfgLanguageCfg.Clear();
  357. return ret;
  358. }
  359. public static Dictionary<string, LanguageCfg> GetLanguageCfg(string path)
  360. {
  361. Dictionary<string, LanguageCfg> ret = new Dictionary<string, LanguageCfg>();
  362. TextAsset ta = AssetDatabase.LoadAssetAtPath<TextAsset>(path);
  363. CsvReader csvReader = new CsvReader(LanguageCfg.FileName_S(), ta.bytes,1,2,3);
  364. LanguageCfg.OnCsvLoad(csvReader);
  365. LanguageCfg.Foreach(it =>
  366. {
  367. if (!ret.ContainsKey(it.key))
  368. {
  369. ret.Add(it.key, it);
  370. }
  371. else
  372. {
  373. ret.Add(it.key+ret.Count,it);
  374. Debug.Log("重复项:" + it.key);
  375. }
  376. //Debug.Log(it.BaseName);
  377. });
  378. LanguageCfg.Clear(false);
  379. return ret;
  380. }
  381. public static void CheckCgf()
  382. {
  383. string luaPath = "Assets/Lua/Config/";
  384. string csvPath = "Assets/Content/Config/";
  385. string OutPutPath = "Build/NewCfg/";
  386. Dictionary<string, List<CfgLanguageCfg>> cfgs = GetCfgLanguageCfg("Assets/Editor/CsvToLua/CfgLanguageCfg.csv");
  387. Dictionary<string, LanguageCfg> language = GetLanguageCfg("Assets/Content/Config/LanguagePackage_cn.csv");
  388. float ckcount = 0;
  389. foreach (var item in cfgs)
  390. {
  391. ckcount+=1;
  392. List<CfgLanguageCfg> value = item.Value;
  393. EditorUtility.DisplayProgressBar("检测配置中", $"检测:{item.Key}...", ckcount/cfgs.Count);
  394. string cfgPath = "";
  395. if (value[0].CfgType == 1)
  396. {
  397. cfgPath = luaPath + item.Key + ".lua";
  398. CheckLauCfg_CS(value,cfgPath,language, $"{OutPutPath}lua/{value[0].CfgName}.lua");
  399. }
  400. else
  401. {
  402. cfgPath = csvPath + item.Key + ".csv";
  403. CheckCsvCfg(value, cfgPath, language, $"{OutPutPath}csv/{value[0].CfgName}.csv");
  404. }
  405. }
  406. EditorUtility.ClearProgressBar();
  407. CsvWriter<LanguageCfg> csvWriter = new CsvWriter<LanguageCfg>(OutPutPath+ "Language.csv", "Language.csv",language.Values.ToList(), LanguageCfg.GetFormatInfo());
  408. csvWriter.Write();
  409. }
  410. private static void CheckLauCfg(List<CfgLanguageCfg> cfg,string path, Dictionary<string, LanguageCfg> language,string outputPath)
  411. {
  412. using (LuaState runTime = new LuaState())
  413. {
  414. runTime.Start();
  415. RolePreviewWindow.LuaForEach<int, LuaTable>(runTime, path, (id,luatable) =>
  416. {
  417. for (int i = 0; i < cfg.Count; i++)
  418. {
  419. if (cfg[i].Enable == 0)
  420. continue;
  421. string value = luatable.RawGet<string, string>(cfg[i].Field);
  422. if (string.IsNullOrEmpty(value))
  423. {
  424. continue;
  425. }
  426. KeyValuePair<string,LanguageCfg> valuePair = language.FirstOrDefault(it =>
  427. {
  428. return string.Equals(it.Value.Language, value);
  429. });
  430. if (!string.IsNullOrEmpty(valuePair.Key))
  431. {
  432. luatable.RawSet<string, string>(cfg[i].Field, valuePair.Key);
  433. }
  434. else
  435. {
  436. string key = cfg[i].CfgID + id;
  437. luatable.RawSet<string, string>(cfg[i].Field, key);
  438. if (value.Contains("\n"))
  439. {
  440. Debug.Log(value);
  441. value = value.Replace("\n","\\n");
  442. Debug.Log(value);
  443. }
  444. language.Add(key,new LanguageCfg() { key = key,Language = value});
  445. }
  446. }
  447. },(ltab)=>
  448. {
  449. bool useObj = IsObj;
  450. if (useObj)
  451. {
  452. LuaState luaState = LuaClient.Instance.luaState;
  453. luaState.DoFile("Assets\\Editor\\CsvToLua\\table-save.lua");
  454. RolePreviewWindow.SaveToLua(luaState, outputPath, ltab, cfg[0].CfgName, "1");
  455. }
  456. else
  457. {
  458. LuaState luaState = runTime;
  459. luaState.DoFile("Assets\\Editor\\CsvToLua\\table-save.lua");
  460. RolePreviewWindow.SaveToLua(luaState, outputPath, ltab, cfg[0].CfgName, "");
  461. }
  462. });
  463. }
  464. }
  465. private static void SetLuaLine(string[] rowDatas,int id,string key,string data,string dataF = "'{0}',")
  466. {
  467. string idkey = $"[{id}]";
  468. string keykey = $"'{key}'";
  469. string wdata = string.Format(dataF,data);//$"'{data}',";
  470. bool isFind = false;
  471. for (int line = 0; line < rowDatas.Length; line++)
  472. {
  473. if (rowDatas[line].Trim().IndexOf("--") == 0)
  474. {
  475. Debug.Log("注释跳过");
  476. }
  477. if (rowDatas[line].Contains(idkey))
  478. {
  479. isFind = true;
  480. }
  481. if (isFind && rowDatas[line].Contains(keykey))
  482. {
  483. int s = rowDatas[line].IndexOf('[');
  484. string p = "";
  485. if (s > 0)
  486. {
  487. for (int i = 0; i < s; i++)
  488. {
  489. p += " ";
  490. }
  491. }
  492. string newstr = $"{p}[{keykey}]={wdata}" ;
  493. rowDatas[line] = newstr;
  494. break;
  495. }
  496. }
  497. }
  498. private static void CheckLauCfg_CS(List<CfgLanguageCfg> cfg, string path, Dictionary<string, LanguageCfg> language, string outputPath)
  499. {
  500. string[] rowDatas = File.ReadAllLines(path);
  501. bool iswrite = true;
  502. using (LuaState runTime = new LuaState())
  503. {
  504. runTime.Start();
  505. RolePreviewWindow.LuaForEach<int, LuaTable>(runTime, path, (id, luatable) =>
  506. {
  507. for (int i = 0; i < cfg.Count; i++)
  508. {
  509. if (cfg[i].Enable == 0)
  510. {
  511. iswrite = false;
  512. continue;
  513. }
  514. string value = luatable.RawGet<string, string>(cfg[i].Field);
  515. if (string.IsNullOrEmpty(value))
  516. {
  517. continue;
  518. }
  519. KeyValuePair<string, LanguageCfg> valuePair = language.FirstOrDefault(it =>
  520. {
  521. return string.Equals(it.Value.Language, value);
  522. });
  523. if (!string.IsNullOrEmpty(valuePair.Key))
  524. {
  525. luatable.RawSet<string, string>(cfg[i].Field, valuePair.Key);
  526. SetLuaLine(rowDatas,id, cfg[i].Field, valuePair.Key);
  527. }
  528. else
  529. {
  530. string key = cfg[i].CfgID + id;
  531. luatable.RawSet<string, string>(cfg[i].Field, key);
  532. if (value.Contains("\n"))
  533. {
  534. //Debug.Log(value);
  535. value = value.Replace("\n", "\\n");
  536. //Debug.Log(value);
  537. }
  538. if (!language.ContainsKey(key))
  539. {
  540. valuePair = language.FirstOrDefault(it =>
  541. {
  542. return string.Equals(it.Value.key, value);
  543. });
  544. if (string.IsNullOrEmpty(valuePair.Key))
  545. {
  546. SetLuaLine(rowDatas, id, cfg[i].Field, key);
  547. language.Add(key, new LanguageCfg() { key = key, Language = value });
  548. }
  549. }
  550. }
  551. }
  552. });
  553. }
  554. if (iswrite)
  555. File.WriteAllLines(outputPath,rowDatas);
  556. }
  557. private static void CheckCsvCfg(List<CfgLanguageCfg> cfg, string path, Dictionary<string, LanguageCfg> language, string outputPath)
  558. {
  559. CsvReader csvReader = new CsvReader(path,1,2,3);
  560. string[][] datas = csvReader.RowDatas;
  561. for (int i = csvReader.StartLine; i < datas.Length; i++)
  562. {
  563. string[] curLine = datas[i];
  564. for (int j = 0; j < cfg.Count; j++)
  565. {
  566. if (cfg[j].Enable == 0)
  567. continue;
  568. string value = csvReader.GetDataByFieldName(cfg[j].Field,i);
  569. if (string.IsNullOrEmpty(value))
  570. {
  571. continue;
  572. }
  573. KeyValuePair<string, LanguageCfg> valuePair = language.FirstOrDefault(it =>
  574. {
  575. return string.Equals(it.Value.Language, value);
  576. });
  577. if (!string.IsNullOrEmpty(valuePair.Key))
  578. {
  579. csvReader.SetDataByFieldName(cfg[j].Field, valuePair.Key, i);
  580. }
  581. else
  582. {
  583. string key = cfg[j].CfgID + i;
  584. csvReader.SetDataByFieldName(cfg[j].Field, key,i);
  585. language.Add(key, new LanguageCfg() { key = key, Language = value });
  586. }
  587. }
  588. }
  589. FileHelper.WirteStringToFile(outputPath,csvReader.GetString());
  590. }
  591. private static void ChangeLuaCfg(string luacfgpath,string luachagepath,string outputPath)
  592. {
  593. string[] rowDatas = File.ReadAllLines(luacfgpath);
  594. using (LuaState runTime = new LuaState())
  595. {
  596. runTime.Start();
  597. LuaTable luaTable = runTime.DoFile<LuaTable>(luachagepath);
  598. RolePreviewWindow.LuaForEach<int, LuaTable>(runTime, luacfgpath, (id, luatable) =>
  599. {
  600. LuaFunction luaFunction = luaTable.GetLuaFunction("IsChangefg");
  601. bool ischange = luaFunction.Invoke<LuaTable,LuaTable, bool>(luaTable,luatable);
  602. if (ischange)
  603. {
  604. LuaTable fieldValue = luaTable.Invoke<LuaTable,LuaTable>("GetFieldAddValue", luaTable);
  605. string field = fieldValue.RawGet<string, string>("field");
  606. string value = fieldValue.RawGet<string, string>("value");
  607. SetLuaLine(rowDatas,id,field,value.ToString(),"{0},");
  608. }
  609. });
  610. }
  611. File.WriteAllLines(outputPath, rowDatas);
  612. }
  613. }