[GAP Forum] AppendTo problem with large strings
Petra Holmes
holmespe at for.mat.bham.ac.uk
Mon Mar 27 15:09:08 BST 2006
Helge,
I'm not sure if there's a proper way of doing it, but this way works for
me.
If you print the string out one character at a time then it doesn't insert
newlines, like this:
for s in string do
AppendTo(file,s);
od;
This gives an output file that is what you want except that it's full of
the character ' but you can get rid of those at the command line using
sed. The command is
sed "s/'//g" file > newfile
using a bash shell, and I suppose it's almost the same in other shells.
Hope this helps,
Beth
On Fri, 24 Mar 2006, Helge wrote:
> Dear GAP supporters!
>
> I am trying to write a large matrix into a text file in such a way
> that scilab is able to read it as input. For this I need to write
> long strings (about 600 characters) into the file and I am doing this
> via AppendTo( filename, string ).
> I realized that this function inserts backslashes and newlines to cut my
> strings into smaller pieces, although I do not intend this. It also is not
> documented in the "AppendTo - function - documentation".
> Funny is, that the length of the dissected pieces correllates with
> the width of my gap terminal window. When I tried to increase
> the width of my gap window significantly, gap quit with a
> memory access error.
> Can someone help me?
>
> I have version 4.4.6.
>
> Thanks in advance,
> Helge
>
> --
>
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
>
More information about the Forum
mailing list