not sure if it will help, but you can directly write an array to a text file. 

click on the help for [table] to see how