Write newline (\n) into file use file:write()

A loop writes value pairs  [for k, v in pairs(snapDataToWrite) do …  ] into a file.  There are NO carriage returns or newlines - all on one line.

“userAddress1”   “456 Avacado St.”"userCity             “Anytown”

How can a newline character be added to that it looks like list at end

inject =  k … "   " … v

print("inject   =  ", inject)

pathSnapAOpenAppend:write( inject )    –  write table/array into file

---------desired file contents / format ------------------

“userAddress1”   “456 Avacado St.”

"userCity             “Anytown”

          etc. 

You have to append your own new-lines and carriage-returns.  Lua (not a Corona thing) does not assume there should be either.

xxx:write( "Bob\n" )

or 

xxx:write( someVariableContainingAString .. "\n" )

formatyourcode.jpg

OK.   Thanks a bunch.  I was  missing the quotes; thought that was just a string.  Appreciated much.  Have a great one.

You have to append your own new-lines and carriage-returns.  Lua (not a Corona thing) does not assume there should be either.

xxx:write( "Bob\n" )

or 

xxx:write( someVariableContainingAString .. "\n" )

formatyourcode.jpg

OK.   Thanks a bunch.  I was  missing the quotes; thought that was just a string.  Appreciated much.  Have a great one.