How Can I do that?? (Exporting)

(Sorry my English is not good. I may write wrong but I can understand everything..)

Hello..
I want to make a script like this..

All triangles have 3 vertex..
and all vertex have x, y and z..

for i = 1 to "NUMBER OF TRIANGLES" (
format "TEX 0"
format "% % % 1.0 1.0", triangle[i].vertex1.x triangle[i].vertex1.y triangle[i].vertex1.z
format "% % % 1.0 1.0", triangle[i].vertex2.x triangle[i].vertex2.y triangle[i].vertex2.z
format "% % % 1.0 1.0", triangle[i].vertex3.x triangle[i].vertex3.y triangle[i].vertex3.z
)

Idon't know commands to do this..

Please help me.. =)