komalak11
6 years agoContributor
Unable to read a text file
Hi,
I am trying to read a text file placed on the desktop using the following piece of code. Unfortunately, the text which is read is gibberish. Can someone please help me out how to read text files correctly.
And how to work the the content of the text file, like finding strings?
sPath ="C:\\Users\\INKKANAM\\Desktop\\API_Error.txt";
myFile = aqFile["OpenTextFile"](sPath, aqFile.faRead,aqFile.ctUnicode);
Log["Message"]("File read");
var sFile = myFile["ReadAll"]();
Log["Message"](sFile);
myFile["Close"]();
Output: See attached picture