Listfiles and arraysort

I am trying to get this text list sorted alphabetically and have been unsuccessful. I have searched this forum and figured I need to use the arraysort. I’ve read the help files but I still cannot sort properly. Any help is appreciated.

arraysort(listfiles(“~/Desktop/test”),¶)

1 Like

I was trying to put the arraysort on a line after listfiles(“~/Desktop/test”) and I didn’t know what to use for paragraph at the end.

Thank you for the solution and the prompt reply.

Text lists require a carriage return-separated text array, and listfiles( produces just such a carriage return-separated array. is an alternative to cr() or chr(13) to produce the carriage return character (ASCII 13) just as ¬ is totab() or chr(9) for ASCII 9, the tab character.

1 Like

You’ve already got a perfectly good solution, but there’s another solution that you might find even easier – just choose the Text List Sort Up option.

Since your list is using carriage return as the separator, just leave the Sep box blank.

1 Like

Hiding in plain sight, at least to me. :face_with_open_eyes_and_hand_over_mouth: Works great. Thanks.

I don’t remember seeing that dialog box. Where is it located?