MV Put a text (.txt file) in a variable

Hi^^
Is it possible to put a text (contained in a .txt file located in a folder of the project) into a variable?

Ie. Put in variable "z" a text contained in .txt file "x", located in folder "y"?
Yeah it's possible. If you have a folder named y in your game's root folder, and inside it there's a text file named x.txt, you can put the contents in variable z via a script call:
$gameVariables.setValue(z, require('fs').readFileSync('y/x.txt', 'utf8'))
Yeah it's possible. If you have a folder named y in your game's root folder, and inside it there's a text file named x.txt, you can put the contents in variable z via a script call:
$gameVariables.setValue(z, require('fs').readFileSync('y/x.txt', 'utf8'))
Awww, that's great! Thank you a lot!!!!
No problem. Glad I could help ^^

Original thread: https://forums.rpgmakerweb.com/threads/put-a-text-txt-file-in-a-variable.133029/