Choose Language Hide Translation Bar
Community Trekker

Read in array from text file? Possible in JSL?

Does anyone know if JSL can read in an array from a text file? any help much appreciated... dj

For example:

array1 = Include("C:\myArray.txt");
where the myArray.txt file would contain in its first line of text: "apple","pear","orange"

so that JSL would eventually interpret:

array1 = {"apple","pear","orange"};
0 Kudos
Community Trekker

Re: Read in array from text file? Possible in JSL? [solved]

After doing a little research I stumbled across the LoadTextFile command:). This solution below works great in case it helps others... So in this case I am able to store large arrays in a separate text file and read them directly into the JSL code. dj

array1 = parse(eval(LoadTextFile(eval()))); //where path is the text file's path+file name.txt which can be represented by a variable. In the text file I wrote the array exactly like this: {"apple","pear","orange"}

Message was edited by: djhanson
0 Kudos