回复 1# eulb
假设灯光文本为1.txt,并已保存为ANSI编码格式,下载gawk(http://bcn.bathome.net/tool/4.1.0/gawk.exe)后执行:- gawk "BEGIN{split(\"tx,ty,tz,qx,qy,qz,R,G,B,Intensity,width,length,LightType\",dat, \",\");for (i=1; i<=length(dat); i++)tA[dat[i]]}/\<Light name=/{print;while((getline)>0){if($0~/<\/Light>/){next};split($0,dat,\"[= \042]+\");for (i=1; i<=length(dat); i++)if(dat[i] in tA)print dat[i],dat[i+1]}}" 1.txt>2.txt
复制代码 2.txt即为你所需要的文档 |