Folks,
I have a list of files that I want to concatenate (see first figure). The preference would be to concatenate as shown, that is "surf_12275-87-1..., "surf_12275-87-2...", etc. However, when I form a list from the files in the folder (after stripping off unnecessary characters) , the sequence is "12275-87-1, 12275-87-10, 12275-87-11". The preference however, would be "12275-87-1, 12275-87-2, 12275-87-3". Obviously the straight forward way around the issue is to have the files come to me in the form of " -01, -02, ... -10, -11", but that will not always be the case.
Is there a straight forward way to get the files into the preferred ranking format so I can open and concatenate from low to high? Current script attached.
s_path = {};
X_path = {};
f1 = Files In Directory( SD1, recursive(1));
For( i = 1, i <= N Items( f1 ), i++,
b = f1[i];
c = Contains Item(b, "surf", "_");
If( c==1,
d = Word(2, b, "_");
Insert Into(s_path,d),
Insert Into(X_path, d)
)
);
Show(s_path);

