I am developing an application to read a text file and plot a graph. the text file will be something like
#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
etc.
I need the value gx1,gy1 . I planned to read them by counting spaces and commas (3 each). But Does it sounds in appropriate? Is there any optimized or more good logic for that?