If I read your spec right, the following will work:
low2mid =. '_'&=`(,:&'-') }
isNum =. *./ @: e.&'0123456789_.abdejprx'
csvminus =. low2mid^:isNum each f.
The rank of the input is irrelevant. I suggest, however, that instead of using
the isNum approach (on a per-cell basis), you
keep track of which columns (or rows, or cells) you intend to be numeric. Then
apply csvminus to only those. It'll be faster
and more importantly, righter. For example:
] users =. 4 2 $ 'userid' ; 'uid' ; 'cool_dude' ; 0 ; 'l33t' ; 1 ;
'bad_dad' ; 2
+---------+---+
|userid |uid|
+---------+---+
|cool_dude|0 |
+---------+---+
|l33t |1 |
+---------+---+
|bad_dad |2 |
+---------+---+
csvminus ": each users
+---------+---+
|userid |uid|
+---------+---+
|cool_dude|0 |
+---------+---+
|l33t |1 |
+---------+---+
|bad-dad |2 |
+---------+---+
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm