Hi Swetha,
I only know how to simplify the first half currently. What you can do is:
let my_files=spawn("ls -1 /datapath/station*.nc")
! it will look like when you use the list command and it is like an array that stores your files one by one
repeat/range=1:25/name=order (define symbol xx=`order`; use 'my_files[x=($xx)]')
! variable order will change every time you do a loop and you need a variable to respond to the changes
For the plotting part, I am not exactly sure. I am guessing that you can use a similar method like
repeat/range=1:25/name=order (define symbol xx=`order`; plot 'T[d=($xx)]')
but I never tried it before. 😹
Best,
Xiaoyu