Here's a "step at a time" method:
]a=. ;: 'cc dd f h gg zz'
┌──┬──┬─┬─┬──┬──┐
│cc│dd│f│h│gg│zz│
└──┴──┴─┴─┴──┴──┘
'h'=>a
0 0
0 0
0 0
1 0
0 0
0 0
+./'h'=>a
1 0
+./"1 'h'=>a
0 0 0 1 0 0
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Strale
Sent: Wednesday, July 8, 2015 5:49 AM
To: [email protected]
Subject: [Jprogramming] Question on E. command
Hello I am trying to learn J
and trying to make a function to tokenise strings
I have tried the E. command but I cannot have it working to search 1 char token
ex:
[a=. ;: 'cc dd f h gg zz'
┌──┬──┬─┬─┬──┬──┐
│cc│dd│f│h│gg│zz│
└──┴──┴─┴─┴──┴──┘
(<'h') E. a
0 0 0 0 0 0
but when I search for a pattern longer as 1 char it works
(<'dd') E. a
0 1 0 0 0 0
How should I use the E. to works with tokens of 1 char length ?
Thank in advance
Paolo
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm