Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fileToTable(file)
- if fs.exists(file)~=true then
- print("file"..file.." not found")
- return(false)
- end
- fp=fs.open(file,"r")
- line={}
- i=1
- line[i]=fp.readLine()
- if line[i]==nil then return(false) end
- while line[i]~=nil do
- i=i+1
- line[i]=fp.readLine()
- end
- return(line)
- end
- function listItems()
- while string.find(itemsRaw,",") do
- items[i]=tonumber(string.sub(itemsRaw,string.find(itemsRaw,"{")+2,string.find(itemsRaw,"]")-1))
- itemsRaw="{"..string.sub(itemsRaw,string.find(itemsRaw,",")+1)
- i=i+1
- end
- end
- namen={}
- names=fileToTable("name")
- i2=1
- for i=1,#names do
- if string.sub(names[i],#names[i],#names[i])=="n" and string.find(names[i],"a") and #names[i]==6 then
- namen[i2]=names[i]
- i2=i2+1
- end
- end
- fp=fs.open("namen","a")
- for i=1,#namen do
- print(namen[i])
- fp.writeLine(namen[i])
- end
- fp.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement