would you be able to rewrite the code so that so it works fully
I don't know what your code is ultimately supposed to do, and I don't have a sample "test.txt" file to work on, so I can't guarantee that anything I write here will work.so i can learn it will work so i can understand it better ?
I believe all of the pieces you need are here, but you seem to be having trouble with how they all work together. Compare the following code with the previous examples, and hopefully that will help. If you have any questions about why it's written the way it is, please ask.
require "lfs"
input = io.open("test.txt","w")
for entry in lfs.dir("test folder") do
if string.match(entry, "\.obj$") ~= nil then
local file = io.open(entry, "r")
for line in file:lines() do
if string.match(line, "v") then
input:write(" GL_Vertex3f ")
end
end
file:close()
end
end
input.close()