function textToArr(file) {
if (file != undefined && file.exists) {
// Read the file to get prepared data from it
file.open('r'); // 'r' means read-only
var content = file.read(); // Read the whole file including line breaks
file.close();
return content.split('\n'); // Convert into an array by splitting at line breaks
} else {
return null;
}
}