I am running the code below it manages to read the file but when I write to the second file the text file mydetails.txt is created but there is no text saved in
mydetails.txt