On Fri, Mar 4, 2011 at 3:37 PM, Lettow, Kenneth <[email protected]> wrote:
> I have a bunch of strings where each string is boxed and each word in
> the string is also boxed.
>
> The problem is to replace any word that contains a number with a generic
> string i.e. "NUMBER".
>
> For example, if the input phrases are:
>
> test=: (<;:'dogs and cats'),(<;:'3 blind mice'),(<<'alpha'),(<;:'6 plus
> 100'),(<;:'robot model r2d2')
>
> The output should be:
>
> output=: (<;:'dogs and cats'),(<;:'NUMBER blind
> mice'),(<<'alpha'),(<;:'NUMBER plus NUMBER'),(<;:'robot model NUMBER')

   'NUMBER'"_^:(_ -.@-:_&".)L:0 test

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

Reply via email to