I get error
"Subscript Range in access or evaluation of 'openDTs[ /*###*/1]' , openDTs[/*###*/1]"
but it works on some folder and I don't get the error...Below is my JSL
JSL "
dir = Set Default Directory("path");
Print(dir);
files = Files In Directory("path");
For(i = 1, i <= N Items(files), i++,
If(Ends With(files[i], ".txt"),
Open(
files[i],
Import Settings(
End Of Line(CRLF, CR, LF),
End Of Field(Comma),
Strip Quotes(0),
Use Apostrophe as Quotation Mark(0),
Scan Whole File(1),
Labels(0),
Column Names Start(1),
Data Starts(1),
Lines To Read(All),
Year Rule("10-90")
)
)
)
);
openDTs = List();
For(i = 1, i <= N Table(), i++,
Insert Into(openDTs, Data Table(i))
);
For(i = 1, i <= N Items(openDTs), i++,
openDTs[i] << New Column("Location", Character, Nominal, Set Each Value(dir));
openDTs[i] << New Column("FileName",
Character,
Nominal,
Set Each Value(openDTs[i] << Get path)
);
);
openDTs1 = openDTs[1];
Remove From(openDTs, 1);
Joined_new = openDTs1 << concatenate(openDTs, output table name("Joined_new"));
"