local filePath = system.pathForFile( "test.csv", system.DocumentsDirectory ) local file = io.open( filePath ) contents={"test1","test2","test3"} file = io.open( filePath, "a" ) for i=1,3 do file:write( contents[1].."," ..contents[2].."," ..contents[3] ) file:write( "\n" ) end io.close( file )