Question: How can I read a page of text into a worksheet as a string.

Suppose I have a file of text that I would like to read into a Maple (16) worksheet as a string. (I have in mind encrypting the string using the RSA encryption scheme.)

If I paste the text directly into the worksheet and surround it by ",  I have no problem, but if I try to read, for example, a file some_text.txt using a command like

     read("C:\\Users\\MyName\\Desktop\\some_text.txt");

I get error messages for each line in the file:

Warning, incomplete string; use " to end the string
Warning, incomplete string; use " to end the string

if in some_text.txt I have, for example, the following:

     s:="This is an example.

     After skipping a line, etc.";

I tried various other extensions instead of .txt such as .docx, rtf. But I still have problems.

I realize that any quotation marks in the text must be replaced by "".

I want to read a plaintext  file, encrypt it and print the encrypted text to another file, which can be read and decrypted to get the original plaintext (keeping all formatting). I can do this inside a worksheet, the problem is reading the files.

 

Please Wait...