我正在开发一个应用程序来读取文本文件并绘制图表。文本文件将类似于
#Pattern Name Item1, Item2, Item3, gx1, gy1, gz1
115, 80, 64, 30.752, 27.587, 15.806
195, 151, 130, 108.983, 102.517, 66.353
94, 123, 156, 43.217, 50.874, 93.700
88, 108, 65, 26.158, 37.980, 17.288
130, 129, 177, 68.096, 66.289, 127.182
100, 190, 171, 71.604, 119.764, 122.349
.........................................
........................................
#Pattern Name2 Item1, Item2, Item3, gx1, gy1, gz1
115, 80, 64, 30.752, 27.587, 15.806
195, 151, 130, 108.983, 102.517, 66.353
94, 123, 156, 43.217, 50.874, 93.700
88, 108, 65, 26.158, 37.980, 17.288
130, 129, 177, 68.096, 66.289, 127.182
100, 190, 171, 71.604, 119.764, 122.349
等等
我需要值 gx1,gy1 。我计划通过计算空格和逗号(每个 3 个)来阅读它们。但这听起来合适吗?是否有任何优化或更好的逻辑?