You may want to look at the mapped file database lab.

It has a very advanced database demo doing similar things.

If you use the J7 lab you need to put in this fix

NB. open '~system\extras\labs\system\mappeddb.ijs'
NB. load '~system\extras\labs\system\mappeddb.ijs'
 open '~addons\labs\labs\system\mappeddb.ijs'
 load '~addons\labs\labs\system\mappeddb.ijs'

You can do it when arriving at that step and then go on

The verb jcreate is also missing in J7 but for now you can just step past it


2011/11/27 Skip Cave <[email protected]>

> Yes, the data is mixed. The first column is an integer, and the second
> column (and all subsequent columns) will be text.
>
> ;: inv"1 ts2    NB. Arie's first suggestion
> |domain error
> |       ;:inv"1 ts2
>
>     ; <@(LF ,~ ;:inv)"1 ] 8!:0 ts2     NB. Ric's suggestion
> |rank error
> |   ;<@(LF,~;:inv)"1]    8!:0 ts2
>
>     require 'tables/dsv'   NB. Ric's second suggestion
>     (' ';'') makedsv ts2
> 355  freeways
> 356  traffic
> 357  ninety one west
> 358  yes
> 361  sixty
>
> NB.  That works!
>
>  ; <@(LF ,~ ;:inv)"1 ts2  NB. Ric's third suggestion
> |domain error
> |   ;    <@(LF,~;:inv)"1 ts2
>
>   f =: 3 :'(":>{.y),'' '',>{:y'  NB. Eelvex's suggestion
>   f"1 ts2
> 355  freeways
> 356  traffic
> 357  ninety one west
> 358  yes
> 361  sixty
>
> NB. That works also!
>
>   fmtmat ts2       NB. Raul's suggestion
> 355  freeways
>
> 356  traffic
>
> 357  ninety one west
>
> 358  yes
>
> 361  sixty
>
>  That works, but with extra line feeds.
>
> Skip
>
> On Sun, Nov 27, 2011 at 6:55 AM, Raul Miller <[email protected]>
> wrote:
>
> > fmtmat=:3 :0
> >  r=. 0 0$t=. 9!:6''
> >  try.
> >    9!:7 ' '"0 t
> >    r=. ": y
> >  catch. end.
> >  9!:7 t
> >  d=. 1#~#$r
> >  d }. (-d) }. r
> > )
> >
> >   fmtmat ts2
> >
> > --
> > Raul
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
>
> --
> Skip Cave
> Cave Consulting LLC
> Phone: 214-460-4861
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Björn Helgason, Verkfræðingur
Fornustekkum II
781 Hornafirði,
t-póst: [email protected]
gsm: +3546985532
twitter: @flugfiskur
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
          /|_      .-----------------------------------.
         ,'  .\  /  | Með léttri lund verður        |
     ,--'    _,'   | Dagurinn í dag                     |
    /       /       | Enn betri en gærdagurinn  |
   (   -.  |        `-----------------------------------'
   |     ) |         (\_ _/)
  (`-.  '--.)       (='.'=)   ♖♘♗♕♔♙
   `. )----'        (")_(") ☃☠
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to