搜索到x时,就开始读入数据,搜索到V时就停止读取数据

来源:百度知道 编辑:UC知道 时间:2024/06/01 04:26:11
facet normal 0.811528 -0.570721 0.125300
outer loop
vertex 137.308319 11.651189 1.073192
vertex 138.194916 13.339867 3.022695
vertex 135.987549 10.617146 4.917568
endloop
endfacet
facet normal 0.146591 -0.154363 -0.977079
outer loop
vertex -48.739738 24.875885 2.289428
vertex -45.140621 22.351807 3.228165
vertex -50.495110 17.923044 3.124506
endloop
endfacet

有一个这样的文本,存放的是很多上面的数据
如果我只想读取vertex后面的的数字数据该如何读取呢
如何设置开始与结束呢
例如:搜索到x时,就开始读入数据,搜索到V时就停止读取数据
能不能帮忙写个代码,谢谢了,c/c++都行的。

读这个数据方法应该很多的,可以用CStdioFile下面的ReadString,每次读入一行,然后可以用Find判断是不是你所需要的,应该就可以读出来了。具体格式你可以msdn一下,不难的。
还有其他的办法,有时间的话可以都试试,^_^,也是学习的机会。