in reply to array in different columns

Do you have the freedom of adapting your data-structure? Here an array of arrays looks much more suitable than the one-dimensional array of values seperated by \n that you use.

HTH, Rata