Take a look at http://www.jsoftware.com/jwiki/Scripts/File_J_Variables.
Example of use:

  load 'WS.ijs'
  sa=: $. 0=25|?1e6$1e9             NB. Make a sparse array.
   'C:\Temp\' fileVar_WS_ 'sa'     NB. Save it in directory "C:\Temp\".
+-+------+
|1|SA.DAT|
+-+------+
  4!:55 <'sa'                                    NB. Erase it
1
  sa                                                  NB. Verify it's gone
|value error: sa
  'C:\Temp\' unfileVar_WS_ 'sa'   NB. Restore from file.
+-+--------------------+
|1|+--------+------+--+|
| ||C:\Temp\|SA.DAT|sa||
| |+--------+------+--+|
+-+--------------------+
  $sa
1000000


On 1/14/07, Fraser Jackson <[EMAIL PROTECTED]> wrote:

Is there some way to save sparse arrays to files.

I have a problem where generating a sparse array takes some time, and I
would like to be able to save it to a file rather than regenerate it.

The usual file utilities do not seem to work and I note that there is no
indication of implementation of the file utilities for sparse arrays in
the
implementation notes.

Is there something simple I am missing, or a simple way of doing this?


Fraser

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




--
Devon McCormick
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to