P� Mon, 14 Jul 2008 10:41:55 +0200, skrev Francogrex <······@grex.org>:
> I create an array and print it to a file as such:
>
> (setf arr #2A((1 2 3) (4 5 6) (7 8 9)))
> (setf out-stream (open "Output.txt" :direction :output))
> (print arr out-stream)
> (close out-stream)
>
> But the output is in the CL array form. Is there a way to print the
> array's columns and rows in a tab-delimited format that can be
> immediadely read as a spreadsheet by something like MS-Excel? Thanks
use format.
~{ ~} are used to iterate over a list. Do a (coerce array 'list) first.
~< ~> are used for tabulated entries.
Also look up ~T ~; ~& ~% ~D ~F
--------------
John Thingstad
On Jul 15, 4:07 pm, "John Thingstad" <·······@online.no> wrote:
> På Mon, 14 Jul 2008 10:41:55 +0200, skrev Francogrex <······@grex.org>:
>
> > I create an array and print it to a file as such:
>
> > (setf arr #2A((1 2 3) (4 5 6) (7 8 9)))
> > (setf out-stream (open "Output.txt" :direction :output))
> > (print arr out-stream)
> > (close out-stream)
>
> > But the output is in the CL array form. Is there a way to print the
> > array's columns and rows in a tab-delimited format that can be
> > immediadely read as a spreadsheet by something like MS-Excel? Thanks
>
> use format.
> ~{ ~} are used to iterate over a list. Do a (coerce array 'list) first.
You cannot (at least directly). You can COERCE to a LIST only VECTORs
(or other SEQUENCEs). Pascal J.B. used the displacing trick but YMMV.
Cheers
--
Marco