Maple 2017.1 on windows 7.
This is VERY frustrating. If I have a string which is too long (do not blame me, it is Maple's output), and try to save it to text file using fprintf(), then Maple decides to insert CARRIAGE RETURN at about each 1,000,000 characters intervals.
So if the string happened to be 5 million chars, and instead of getting one long line in the file for this one result, It writes 5 lines in the file.
Becuase of this, I can't postprocess this output, since the program that reads the file expects one line per one result. So it fails to parse it. And having to post process the file to correct this is not easy at all.
Why is there a limitation of writing long string to a file without it being chopped of like this? Is there a way to work around this? Here is a MWE
fd := fopen("out.txt",WRITE):
As you can see, I wrote the result as one string. Now if you look at the file out.txt in the directory (you might want to use good editor for this, such as vi or textedit), you will see many lines in there, and not one long line as expected. Or you can run this code
while line <>0 do
number_of_lines :=number_of_lines + 1:
print(` number of lines read is `,number_of_lines);
The above gives
` number of lines read is `, 24
This problem now means I am not able to continue with what I am doing. Does this happen on other platforms?
I think this happens due to Maple limits
`[Length of output exceeds limit of 1000000]`
However, I am NOT dispalying anything on the screen. This is all going to text files. It seems Maple output limits of 1,000,000 is confusing fprintf() to a file as well?