Hi can someone please help me. I am trying to save a list to a file but the code below saves the list with spaces. So when i open the file they all have spaces after each number(see below). How can i save the list as it is?
Q1)
restart:
with(FileTools[Text]):
document:= "C:\\Users\\y\\Desktop\\Hello.txt":
z:= ReadCharacter(document):
ListOfCharacter:=[]:
while z <> NULL do
ListOfCharacter:=[op(ListOfCharacter),z]:
z:= ReadCharacter(document):
end do:
ListOfCharacter;
L:= ListOfCharacter:
for Character in L do
f:=L->map(op@convert,L,bytes):
end do:
f(L);
x:=f(L):
with(FileTools):
outputfile:= "C:\\Users\\y\\Desktop\\test3.txt":
writedata(outputfile,[x]):
close(outputfile):
Text[ReadLine](outputfile);
["h", "e", "l", "l", "o"]
[104, 101, 108, 108, 111]
"104 101 108 108 111"
Q2)Write a procedure that reads the list of numbers from Q1 encrypts the list and writes the list of numbers to a file. The program should prompt the user for the values of n and e to use for "F:=(n,e,L)->map(x->x^e mod n,L):"
I have tried a lot of ways to do this but i can't seem to succeed. I would be very gratefull for any help.