Hi,
I have a n x m matrix filled with ones and zeros:
#2A((1 0 1 1 1 1 0)
(1 0 1 1 1 1 1)
(1 1 1 0 1 1 1)
(1 1 1 1 0 1 1)
(0 1 1 1 1 1 0))
I want to store the values of this matrix in a text file like that,
whereas a tab (\t) should be placed between the single values and a
newline (\n) at the end of each line:
1 0 1 1 1 1 0
1 0 1 1 1 1 1
1 1 1 0 1 1 1
1 1 1 1 0 1 1
0 1 1 1 1 1 0
How can I write this structure in a text file without using streams?
Thanks!
D.
In article <························@b79g2000hse.googlegroups.com>,
··············@web.de wrote:
> Hi,
>
> I have a n x m matrix filled with ones and zeros:
> #2A((1 0 1 1 1 1 0)
> (1 0 1 1 1 1 1)
> (1 1 1 0 1 1 1)
> (1 1 1 1 0 1 1)
> (0 1 1 1 1 1 0))
> I want to store the values of this matrix in a text file like that,
> whereas a tab (\t) should be placed between the single values and a
> newline (\n) at the end of each line:
roughly:
WITH-OPEN-FILE direction output
dotimes i
dotimes j
write element i j
write tab
write newline
> 1 0 1 1 1 1 0
> 1 0 1 1 1 1 1
> 1 1 1 0 1 1 1
> 1 1 1 1 0 1 1
> 0 1 1 1 1 1 0
>
> How can I write this structure in a text file without using streams?
You can call system functions via a FFI.
Why would you not use streams?
>
> Thanks!
> D.
--
http://lispm.dyndns.org