View Single Post
  #1  
Unread 11-17-2011, 12:33 PM
nuna nuna is offline
The Wary
 
Join Date: Nov 2011
Posts: 1
Unhappy I'm having troubles with text output in my code with lua :(

Hello i'm having troubles with text output when I search file for &A "Non letter characters" how come my ObjectOuput.txt doesn't output it?

Code:
require "lfs"
 
 
 
 
input = io.open("ObjectOutput.txt","w")
 
 
filename = ".obj"
 
pattern = "\.obj$"
 
for dir_elem in lfs.dir("test folder") do
        local target = "test folder" .. "/" .. dir_elem
        if lfs.attributes(target).mode == "file" then
 
                if string.match(filename,pattern) then
 
                        local file = io.open(target, "r")
 
 
 
                                for match in file:lines("%v") do
 
 
 
                                input:write(" test ")
 
 
 
end
 
 
 
                                        for match in file:lines("%A") do
 
 
                                        input:write(" ",match)
end
 
 
 
 
 
 
--END LINE
end
 
end
end
Reply With Quote