Greetings,

Years ago I wrote a function in APL to take a string vector and split it
into a matrix at the point of the commas in the string.  It really came in
handy for the business applications I was writing.  I converted it to J and
thought I would share it as follows:

words =: 3 : 0
(($r),>./r)$(,r>/i.>./r=._1+(r,1+$a)-0,r=.(a=',')#1+i.$a)#inv(a~:',')#a=.,y
)


   words 'hello there,how,are,you today?'
hello there
how
are
you today?


Blake McBride
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to