I wrote X = [[1,2,3,4,5,6],[6,5,4,3,2,1]|...] to a file by the following code:
?-tell('test.txt'),maplist(format('~d ~d ~d ~d ~d ~d ~n'),X),told.
$cat test.txt
1 2 3 4 5 6
6 5 4 3 1 1
...
And using the following code to restore it:
?-open("test.txt",read,F),read_stream_to_codes(F,N),write(N),close(F).
N = [49, 50, 51, 52, 53, 54 ...]
what's the best way to convert N to [[1,2,3,4,5,6],[6,5,4,3,2,1]...] ?
Sincerely!